©
本文档使用
php.cn手册 发布
(PECL mongo >=0.9.0)
MongoCursor::limit — Limits the number of results returned
$num
)
num
The number of results to return.
Returns this cursor.
Throws MongoCursorException if this cursor has started iterating.
[#1] vinicius at codemakers dot com dot br [2013-12-24 14:49:56]
//Show only unique result
$cursor = $collection->find();
$cursor->limit(1);