MongoDB DBA · Question 415 · Single choice

Given the following query: find({"genre": "action"}).sort({"year": 1}).skip(100).limit(20) Which of the following steps would be executed by the mongos process, not by the mongod processes on each shard? Choose the best answer:

Answer options

  1. A.
    Sorting the result set in memory, without an index
  2. B.
    Walking an index to fetch the documents
  3. C.
    Looking for documents that have a field genre with value action
  4. D.
    Performing a skip operation of 100 documents
  5. E.
    Applying a limit of 120 documents

Answer confidence: Medium

Correct answer: A

Explanation language: Chinese

查询被下发到相关分片后,过滤(A)与走索引取文档(E)由各分片完成,limit 结果上限(D 中的 120 = 100+20)也会下推到分片;而把各分片返回的有序结果在内存里做归并排序、且没有可用的单一索引,只能由 mongos 承担,因此选 C。

Papers containing this question

This question appears in 2 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 ↗