MongoCursor::limit

(PECL mongo >=0.9.0)

MongoCursor::limitLimits the number of results returned

Açıklama

public MongoCursor::limit ( int $num ) : MongoCursor

Değiştirgeler

num

The number of results to return.

Dönen Değerler

Returns this cursor.

Hatalar/İstisnalar

Throws MongoCursorException if this cursor has started iterating.

Ayrıca Bakınız

add a note add a note

User Contributed Notes 1 note

up
0
vinicius at codemakers dot com dot br
6 years ago
//Show only unique result

$cursor = $collection->find();
$cursor->limit(1);
To Top