robbiblubber.org

help | login | search:  
>>

show wiki  show source  compare to current  compare to previous  read  history 


limit()


MongoDB Driver Function Reference


Restricts the number of rows returned.
More information can be found in the corresponding entry of the MongoDB Manual.


<cursor>.limit(<number>)



Arguments


<cursor> A result set.
<number> Maximum number of rows to return.



Returns


Returns a result set (cursor).



Example


db.employees.find().limit(10);


Returns a maximum of ten documents from the employee collection.




home | MongoDB Driver Function Reference | MongoDB Driver