In MongoDB, Multikey Indexes are used to index a field that holds an array value. Which of the following is true about Multikey Indexes? Check all that apply:
题目选项
- A.They contain one index key value per element in the array indexed.
- B.They cannot be created using the createIndex operation.
- C.They can be used for sorting.
答案置信度:中
正确答案:A、C
解析语言:中文
A 是 multikey 索引的定义:数组字段的每个元素都会生成一个索引键(同一文档因此可能出现多条索引记录)。B 错:multikey 索引不需要特殊语法,用 createIndex 对数组字段建普通索引就会自动成为 multikey。C 成立:multikey 索引虽然不能覆盖(cover)查询、对数组字段本身的排序也有额外限制,但它在受支持的排序模式下仍可用来提供顺序,所以本题 A、C 都对。