| |
read source history
= 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 [[https://docs.mongodb.com/manual/reference/method/db.getSiblingDB/index.html|MongoDB Manual]].
[[[@cG
db.getSiblingDB(<name>)
]]]
**Arguments**
[[[@w
|@t0@r0@c0 <name> | | Database name. |
]]]
**Return Value**
[[[@w
Returns a database.
]]]
**Example**
[[[@cw
db.getSiblingDB("company").getCollection("employees").find();
]]]
Gets the //employees// collection in the //company// database and calls the find() method on the collection.
----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]
|