PHP 7.2.0 Release Candidate 4 Released

MongoCursor::limit

(PECL mongo >=0.9.0)

MongoCursor::limitLimits the number of results returned

Beschreibung

public MongoCursor MongoCursor::limit ( int $num )

Parameter-Liste

num

The number of results to return.

R├╝ckgabewerte

Returns this cursor.

Fehler/Exceptions

Throws MongoCursorException if this cursor has started iterating.

Siehe auch

add a note add a note

User Contributed Notes 1 note

up
5
vinicius at codemakers dot com dot br
3 years ago
//Show only unique result

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