MongoDB DBA · Question 293 · Multiple choice

12. Suppose you have a sharded collection called products with the following chunk ranges: { "productId" : { "$minKey" : 1 } } -->> { "productId" : 9294 } on : shard0000 { "t" : 2, "i" : 0 } { "productId" : 9294 } -->> { "productId" : 18684 } on : shard0002 { "t" : 3, "i" : 0 } { "productId" : 18684 } -->> { "productId" : 27851 } on : shard0003 { "t" : 4, "i" : 0 } { "productId" : 27851 } -->> { "productId" : 36852 } on : shard0004 { "t" : 5, "i" : 0 } { "productId" : 36852 } -->> { "productId" : 46047 } on : shard0005 { "t" : 6, "i" : 0 } { "productId" : 46047 } -->> { "productId" : 55450 } on : shard0006 { "t" : 7, "i" : 0 } { "productId" : 55450 } -->> { "productId" : 64644 } on : shard0007 { "t" : 8, "i" : 0 } { "productId" : 64644 } -->> { "productId" : 73769 } on : shard0000 { "t" : 9, "i" : 0 } { "productId" : 73769 } -->> { "productId" : 82950 } on : shard0002 { "t" : 10, "i" : 0 } { "productId" : 82950 } -->> { "productId" : 91983 } on : shard0001 { "t" : 10, "i" : 1 } { "productId" : 91983 } -->> { "productId" : { "$maxKey" : 1 } } on : shard0001 { "t" : 1, "i" : 10 } Which shards would be involved in answering the following query? db.products.find({ "$or": [ { "productId" : { "$gte": 91983 }, { "productId": { "$lt": 18684 } } } ] }) Check all that apply:

Answer options

  1. A.
    shard0001
  2. B.
    shard0000
  3. C.
    shard0003
  4. D.
    shard0004
  5. E.
    shard0002

Answer confidence: Low

Correct answer: A, B, E

Explanation language: Chinese

题干里的 $or 在源文档转录时已损坏(数组里只有一个元素,且同一对象里出现了无名字段),按 MongoDB 原题应理解为 $or:[{productId:{$gte:91983}},{productId:{$lt:18684}}],解析结论才是确定的。按此语义:$gte 91983 命中 [91983,maxKey) → shard0001;$lt 18684 命中 [minKey,9294) → shard0000 与 [9294,18684) → shard0002。因此涉及 shard0002、shard0001、shard0000(A、C、E);选项顺序在不同真题文档里被打乱过,务必以位置为准。

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 ↗