Returns the information and data from a collection.
Last updated 2 years ago
Was this helpful?
Parameter
Description
name
The name of the collection
Returns
|
The collection with the provided name
db.collections; // [Collection { name: 'users', entries: 1 }] db.getCollection('users'); // Collection { name: 'users', entries: 1 } db.getCollection('posts'); // null