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._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.+以打开“创建集合”对话框。
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.(可选)在expireAfterSeconds字段中输入秒数。
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.expireAfterSeconds字段是一个TTL索引,可以自动删除超过指定秒数的文档。expireAfterSeconds字段必须为正值、非零值。