Manage Collections in Compass (original) (raw)

A collection is a grouping of MongoDBdocuments. Documents within a collection can have different fields. A collection is the equivalent of a table in a relational database system. A collection exists within a single database.

The Collections screen lists the existingcollections andviews in the selected database. Each list item includes the name and other general information for the collection or view.

To access the Collections screen for a database, from theDatabases screen either:

Select database

click to enlarge

The Collections screen displays the following information for each collection in the selected database:

Note

Compass bases the document count that appears on theCollections screen on cached metadata usingcollStats. This count might differ from the actual document count in the collection. For example, an unexpected shutdown can throw off the count. Use the db.collection.countDocuments() method for the most accurate document count.

You can create new collections in an existing database.

From the Collections screen, click theCreate Collection button.

From the Collections screen, click on the trash can for the collection to delete. A confirmation dialog appears.

In the dialog, enter the name of the collection to delete.

The Collection Detail screen shows detailed information for a collection, including the documents the collection contains. To see collection details, either:

After you select a collection, Compass shows you that collection's Documents tab. Compass provides the following collection information and functionality in the detailed view:

Note

Data Lake Limitations

The following functionality is not available if you are connected to a Data Lake:

You can open multiple Collection Detail screens in separate tabs. To open a new tab to view collection details: