(No version information available, might only be in Git)
CollectionFind::limit — Limit number of returned documents
$rows
)Limit the amount of documents returned by the 'find' option by the amount provided as argument
rows
This is the maximum amount of documents that have to be returned by the find operation
CollectionFind object that can be used for further processing
Example #1 mysql_xdevapi\CollectionFind::limit() example
<?php
//Assuming $coll is a valid Collection object
//Extract only the first 10 documents from the collection
$res = $coll->find()->limit(10)->execute();
//Sort the documents on the base of the 'age' field
//and return the first two "oldest" person in the collection
$res = $coll->find()->sort('age desc')->limit(2)->execute();
?>