Create a Clustered Collection创建群集集合
On this page本页内容
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.当只需要一个聚集索引时,可以使用聚集集合。
Restrictions限制
Clustered collection limitations:群集集合限制:
The clustered index key must be on the聚集索引键必须位于_id
field._id
字段上。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.+
以打开“创建集合”对话框。

(Optional) Enter the number of seconds for the expireAfterSeconds field.(可选)为expireAfterSeconds
字段输入秒数。
The expireAfterSeconds field is a TTL index that enables automatic deletion of documents older than the specified number of seconds. expireAfterSeconds
字段是一个TTL索引,用于自动删除超过指定秒数的文档。The expireAfterSeconds field must be a positive, non-zero value.expireAfterSeconds
字段必须是一个正的非零值。