Index Properties索引属性
In addition to the numerous index types MongoDB supports, indexes can also have various properties. 除了MongoDB支持的众多索引类型外,索引还可以具有各种属性。The following documents detail the index properties that you can select when building an index.以下文档详细介绍了在构建索引时可以选择的索引属性。
TTL IndexesTTL索引The TTL index is used for TTL collections, which expire data after a period of time.TTL索引用于TTL集合,该集合在一段时间后使数据过期。Unique Indexes唯一索引A unique index causes MongoDB to reject all documents that contain a duplicate value for the indexed field.唯一索引会导致MongoDB拒绝所有包含索引字段重复值的文档。Partial Indexes部分索引A partial index indexes only documents that meet specified filter criteria.部分索引只对符合指定筛选条件的文档进行索引。Case Insensitive Indexes不区分大小写的索引A case insensitive index disregards the case of the index key values.不区分大小写的索引忽略索引键值的大小写。Hidden Indexes隐藏索引A hidden index is not visible to the query planner.隐藏索引对查询计划器不可见。Sparse Indexes稀疏索引A sparse index does not index documents that do not have the indexed field.稀疏索引不会为没有索引字段的文档编制索引。