Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardMongoDBCovered queries internalsSingle-choice MCQ

An index {status:1, qty:1} exists. This query returns totalDocsExamined: 5 in explain even though every needed field is in the index. What single change makes it a covered query (totalDocsExamined: 0)?

db.items.createIndex({ status: 1, qty: 1 }) db.items.find( { status: "A" }, { status: 1, qty: 1 } )