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

For a query to be a 'covered query', all fields the query needs (in the filter, projection, and sort) must come from the index, with no document fetch. Given index { a: 1, b: 1 } and the query below, why is this query NOT covered even though a and b are both indexed?

db.coll.find({ a: 1 }, { b: 1 }) // index: { a: 1, b: 1 }