Navigation

database.collection()

On this page

Definition

database.collection(name)

Returns a collection object. Ensure that rules are set for the collection namespace or all operations on the collection will fail. See MongoDB Rules.

The database.collection() method has the following parameter.

Parameter Type Description
name string The name of the collection.
Returns:A collection object.