MongoCursor
PHP Manual

MongoCursor::softLimit

(PECL mongo >=0.9.0)

MongoCursor::softLimitLimits the number of results initially returned

Описание

public MongoCursor MongoCursor::softLimit ( int $num )

Список параметров

num

The number of results to return.

Возвращаемые значения

Returns this cursor.

Errors/Exceptions

Throws MongoCursorException if this cursor has started iterating.

Примеры

Пример #1 MongoCursor::softLimit() and MongoCursor::limit() example

limit() and softLimit() are mutually exclusive, and whichever one comes last will "win":

<?php
// 20 returned
$cursor1 $collection->find()->softLimit(10)->limit(20);

// all documents returned, 10 sent to the client on initial request
$cursor2 $collection->find()->limit(20)->softLimit(10);
?>

MongoCursor
PHP Manual