Docs Menu
Docs Home
MongoDB Compass
/ /

Create a Clustered Collection

On this page

  • Restrictions
  • Steps
  • Next Steps

Clustered collections are collections with a clustered index. Clustered collections store documents ordered by clustered index key value. You can use clustered collections when only one clustered index is necessary.

Clustered collection limitations:

  • The clustered index key must be on the _id field.

  • Clustered collections may not be capped collections.


Select a database and from the Collections screen, click the Create Collection button.

You can also click the + next to the name of the database you select to open the Create Collection dialog box.


From the Additional preferences drop-down, select Clustered Collections.


You can enter a name for the clustered index or use the automatically generated name.


The expireAfterSeconds field is a TTL index that enables automatic deletion of documents older than the specified number of seconds. The expireAfterSeconds field must be a positive, non-zero value.


In the Collections screen, your new collection is marked by a Clustered badge next to the collection name.

  • Manage Documents

  • Query Your Data

  • Analyze Your Data Scheme


Create a Collection with Collation


Create a Collection with Queryable Encryption