Can someone explain for the quiz why the answer is the following:
db.example.find( { name : { $in : [ “Bart”, “Homer” ] } }, {_id : 0, dob : 1, name : 1} )
Based on the following indexes that are created:
{ _id: 1 }
{ name: 1, dob: 1 }
{ hair: 1, name: 1 }
Shouldn’t the answer be the following:
db.example.find( { name : { $in : [ “Bart”, “Homer” ] } }, {_id : 0, hair : 1, name : 1} )
Based on the definition of a covered query (all fields in the query are a part of the index and all the fields are turned in the result are in the same index.)