robbiblubber.org

help | login | search:  
>>

read  source  history 


first()


MongoDB Driver Function Reference


Returns the first rows of a result set.



<cursor>.first([<number>])



Arguments


<cursor> A result set.
<number> Maximum number of rows to return (default: 1).



Returns


Returns a result set (cursor).



Example


db.employees.find().first(2);


Returns a maximum of two documents from the first rows of the employee collection.






home | MongoDB Driver Function Reference | MongoDB Driver