Manage Collections in Compass
A collection is a grouping of MongoDB documents. 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.
Collections Screen
The Collections screen lists the existing collections and views 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 the Databases screen either:
Click a Database Name in the main Databases view, or
Click a database in the left navigation.
Collection Information
The Collections screen displays the following information for each collection in the selected database:
Collection name
Number of documents in the collection
Note
Compass bases the document count that appears on the Collections screen on cached metadata using collStats. 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.
Average size of documents in the collection
Total size of all documents in the collection
Number of indexes on the collection
Total size of all indexes on the collection
Collation properties for the collection. Hover over a Collation banner to view the properties for that collection.
Create a Collection
You can create new collections in an existing database.
Drop a Collection
Collection Details
The Collection Detail screen shows detailed information for a collection, including the documents the collection contains. To see collection details, either:
Click a Collection Name in the main Collections screen, or
Click a collection in the left navigation.
Open the collection in a new tab.
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:
Import and Export Data to and from the collection
Note
Data Lake Limitations
The following functionality is not available if you are connected to a Data Lake:
Import data into a collection
Schema Analysis
View Query Performance
Manage Indexes
Set Validation Rules for Your Schema
Tabbed View
You can open multiple Collection Detail screens in separate tabs. To open a new tab to view collection details:
Limitations
Creating and dropping collections is not permitted in MongoDB Compass Readonly Edition.
The Create Collection button is not available if you are connected to a Data Lake.