MongoDB DEV · Question 61 · Multiple choice

Consider the query: db.sample.find({ "b": { "$gte": 4, "$lte": 6 } }) Assuming all documents exist in the sample collection, which of the following documents would be returned by this query? Check all that apply:

Answer options

  1. A.
    { "_id": 24 , "a": 3 , "b": 3 }
  2. B.
    { "_id": 1 , "a": 1 , "b": 10 }
  3. C.
    { "_id": 25 , "a": 3 , "b": 7 }
  4. D.
    { "_id": 13 , "a": 2 , "b": 6 }
  5. E.
    { "_id": 26 , "a": 3 , "b": 5 }

Answer confidence: High

Correct answer: D, E

Explanation language: Chinese

$gte:4 且 $lte:6 表示 b 落在 [4,6] 区间:_id 13 的 b=6、_id 26 的 b=5 会被返回。b=3 小于下界,b=7 和 b=10 大于上界,均不匹配。

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 ↗