In a sharded cluster, which of the following require unique values? Check all that apply:
题目选项
- A.The index used as the Shard Key
- B.Any single-field index
- C.The default index on _id
答案置信度:高
正确答案:C
解析语言:中文
分片集群中 _id 的默认索引必须唯一(_id 不是分片键时,唯一性只在各分片内部保证),所以选 C。A 错:作为分片键的那个索引本身不要求唯一,只有显式声明 unique 才是唯一索引;B 错:普通单字段索引可以是普通索引,也可以带 unique/sparse/partial 等不同选项,并非必须唯一。