Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Jokes
Docs Menu
Docs Home
/ / /

Create a Clustered Collection

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.

1
  1. If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your project from the Projects menu in the navigation bar.

  3. In the sidebar, click Data Explorer under the Database heading.

    The Data Explorer displays.

Note

You can also go to the Clusters page, and click Data Explorer under the Shortcuts heading.

2

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.

3
4

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

5

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

6

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.

7

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

Back

Collections with Collation

On this page