robbiblubber.org

help | login | search:  
>>

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


db.getSiblingDB()


MongoDB Driver Function Reference


Gets a database. This allows commands being executed on databases other than the current one.
More information can be found in the corresponding entry of the MongoDB Manual.



db.getSiblingDB(<name>)



Arguments


<name> Database name



Return Value


Returns a database.



Example


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


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








home | MongoDB Driver Function Reference | MongoDB Driver