- Reference >
mongoShell 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 namestring The name of the collection.