MongoDB Exam Questions / Learn / Paper 8 / Question 370 MongoDB DBA · Question 370 · Multiple choice
Consider the following index in the buildings collection:
{ height: 1 }
Which of the following queries could use this index?
Check all that apply: Answer options A. db.buildings.find({ year: { $lte: 1980 } })
B. db.buildings.find({ height: { $gt: 50 } })
C. db.buildings.find({ height: 100, city: "London" })
Answer confidence: High
Correct answer: B, C Explanation language: Chinese 单字段索引 {height:1} 只能服务带 height 条件的查询:A 是 height 的范围查询,C 是 height 等值过滤后再用 city 做残余过滤,两种都能先用索引缩小候选文档。B 只查 year,索引中根本没有该字段,只能全集合扫描。C 里 city 没有索引并不妨碍使用 height 索引,只是过滤要回表后再判断。
Start learning
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.
Questions come from this project's existing bank. Answers and Chinese explanations are AI-generated. Data checks cover field formats, answer-to-option mapping, and answer consistency across duplicate questions. Confidence is not official endorsement or a correctness guarantee. Check the MongoDB documentation for your version.
Independent study resource; not affiliated with MongoDB. MongoDB documentation