robbiblubber.org

help | login | search:  
>>

read  source  history 


estimatedDocumentCount()


MongoDB Driver Function Reference


Returns the count of all documents in a collection or view.
More information can be found in the corresponding entry of the MongoDB Manual.



<collection>.estimatedDocumentCount([<options>])



Arguments


<collection> The target collection.
<options> A BOSN document specifying options.



Options


{ maxTime: <long> }

maxTime The maximum amount of time to allow the count to run.



Return Value


Returns a result set (cursor).



Example


db.employees.estimatedDocumentCount({ salary: { $gt: 700000 }});


Returns the number of documents in the employees collection.




home | MongoDB Driver Function Reference | MongoDB Driver