MongoDB DBA · Question 239 · Multiple choice

17. Which of the following is/are true of single field indexes? Check all that apply:

Answer options

  1. A.
    Single field indexes cannot index embedded documents or nested fields.
  2. B.
    Single field indexes can only index the top-level fields in documents.
  3. C.
    Single field indexes can be sorted in ascending or in descending order.

Answer confidence: High

Correct answer: C

Explanation language: Chinese

单字段索引既可用升序(1)也可用降序(-1)创建,查询的排序方向可以由索引正/反向扫描来满足,所以 B 正确。A、C 错:单字段索引可以建在嵌套字段或整个内嵌文档上,例如 {"address.city": 1},并不是只能索引顶层字段,也不是不能索引嵌套字段。

Papers containing this question

This question appears in 3 bank records. Public pages combine identical prompts and options. Selected questions display the highest-confidence record; the others show a short preview. Paper-based learning preserves each record's answer, explanation, and confidence.

AUTHOR · PROJECTS · OPEN SOURCE

Author & MongoDB projects

Building data platforms, MongoDB migration and sync tools, and cloud operations products.

Contact the author for any MongoDB needs.

Contact the author ↗mlhp123@outlook.com

Support the author

If this question bank helps you, optional donations are welcome.

Scan with Alipay to support the authorOpen full-size donation image ↗