- Reference >
mongo
Shell Methods >- Database Methods >
- db.getCollection()
db.getCollection()¶
On this page
Description¶
-
db.
getCollection
(name)¶ Returns a collection name. This is useful for a collection whose name might interact with the shell itself, such names that begin with
_
or that mirror the database commands.The
db.getCollection()
method has the following parameter:Parameter Type Description name
string The name of the collection.