标签: php mongodb
我如何将这个shell翻译成php:
db.products.find({}, {comments:{$slice: 5}}
答案 0 :(得分:2)
你有什么尝试?
这看起来很简单:
db->products->find( array(), array('comments' => array( '$slice' => 5 ) ) );
简单的翻译有什么特别的错误吗?