MongoCursor::limit

(PECL mongo >=0.9.0)

MongoCursor::limitLimits the number of results returned

Descrierea

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

Parametri

num

The number of results to return.

Valorile întoarse

Returns this cursor.

Erori/Excepții

Throws MongoCursorException if this cursor has started iterating.

A se vedea și

add a note add a note

User Contributed Notes 1 note

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

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