| |
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 [[https://docs.mongodb.com/manual/reference/method/db.getCollection/index.html|MongoDB Manual]].
db.getCollection("col") //can be substituted by using// db.col.
[[[@cG
db.getCollection(<name>)
]]]
**Arguments**
[[[@w
|@t0@r0@c0 <name> | | Collection name. |
]]]
**Return Value**
[[[@w
Returns a collection.
]]]
**Example**
[[[@cw
db.getCollection("employees").find();
]]]
Gets the //employees// collection and calls the find() method on the collection.
----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]
|