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.
Limitations
Clustered collection limitations:
- The clustered index key must be on the
_idfield. - Clustered collections may not be capped collections.
Steps
Open the Create Collection dialog box.
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.
Select the type of collection you want to create.
From the Additional preferences drop-down, select Clustered Collections.
(Optional) Name your clustered index.
You can enter a name for the clustered index or use the automatically generated name.
(Optional) Enter the number of seconds for the expireAfterSeconds field.
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.