MongoCursor::limit

(PECL mongo >=0.9.0)

MongoCursor::limitLimits the number of results returned

설명

public MongoCursor MongoCursor::limit ( int $num )

인수

num

The number of results to return.

반환값

Returns this cursor.

오류/예외

Throws MongoCursorException if this cursor has started iterating.

참고

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