Navigation
This version has reached end of life on October 2016. Learn more about upgrading your version of MongoDB.

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.