Can I use {stars: 1, cuisine: 1}?
It is being treated as an incorrect answer but it still executes fine on my laptop with the following winning plan:
"winningPlan" : { "stage" : "PROJECTION", "transformBy" : { "cuisine" : 1, "stars" : 1, "_id" : 0 }, "inputStage" : { "stage" : "IXSCAN", "keyPattern" : { "stars" : 1, "cuisine" : 1 }, "indexName" : "stars_1_cuisine_1", "isMultiKey" : false, "multiKeyPaths" : { "stars" : [ ], "cuisine" : [ ] }, "isUnique" : false, "isSparse" : false, "isPartial" : false, "indexVersion" : 2, "direction" : "forward", "indexBounds" : { "stars" : [ "(2.0, inf.0]" ], "cuisine" : [ "[MinKey, MaxKey]" ] } } },
Besides, it does not fetch, which follows the part of the lecture “Covered Queries”. Although I am not sure if it would be quicker since I didn’t figure out how to show the executionStats of aggregation.