robbiblubber.org

help | login | search:  
>>

read  source  history 


getCollection()


MongoDB Driver Function Reference


Gets a collection by its name.
More information can be found in the corresponding entry of the MongoDB Manual.

db.getCollection("col") can be substituted by using db.col.



db.getCollection(<name>)



Arguments


<name> Collection name.



Return Value


Returns a collection.



Example


db.getCollection("employees").find();


Gets the employees collection and calls the find() method on the collection.





home | MongoDB Driver Function Reference | MongoDB Driver