Show
Run the following four commands (the last command is repeated twice):
db.test.createIndex({x:1})
db.test.createIndex({y:1})
db.test.explain().aggregate([{$match:{x:1,y:1}}])
db.test.explain().aggregate([{$match:{x:1,y:1}}])
Output of the second .explain() in 3.2.9 is:
> db.test.explain().aggregate([{$match:{x:1,y:1}}])
{
"waitedMS" : NumberLong(0),
"stages" : [
{
"$cursor" : {
"query" : {
"x" : 1,
"y" : 1
},
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "test.test",
"indexFilterSet" : false,
"parsedQuery" : {
"$and" : [
{
"x" : {
"$eq" : 1
}
},
{
"y" : {
"$eq" : 1
}
}
]
},
"winningPlan" : {
"stage" : "CACHED_PLAN",
"inputStage" : {
"stage" : "FETCH",
"filter" : {
"x" : {
"$eq" : 1
}
},
"inputStage" : {
"stage" : "IXSCAN",
"keyPattern" : {
"y" : 1
},
"indexName" : "y_1",
"isMultiKey" : false,
"isUnique" : false,
"isSparse" : false,
"isPartial" : false,
"indexVersion" : 1,
"direction" : "forward",
"indexBounds" : {
"y" : [
"[1.0, 1.0]"
]
}
}
}
},
"rejectedPlans" : [ ]
}
}
}
],
"ok" : 1
}