(PECL mongo >=0.9.0)
MongoCursor::softLimit — Limits the number of results initially returned
The number of results to return.
Returns this cursor.
Throws MongoCursorException if this cursor has started iterating.
Example #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);
?>