Hello
I’m using aggregate call and the explain returns the below output.
2. It seems my query is using index, in this case. Also, is there a way to to get the executionStats for aggregate explain
--
aggregate explain output
{
"stages" : [
{
"$cursor" : {
"query" : {
"pid" : "111222334",
"re" : false,
"ig" : false
},
"fields" : {
"c" : 1,
"ft" : 1,
"ig" : 1,
"lt" : 1,
"nm" : 1,
"pid" : 1,
"re" : 1,
"tid" : 1,
"_id" : 1
},
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "jstesterror.error",
"indexFilterSet" : false,
"parsedQuery" : {
"$and" : [
{
"ig" : {
"$eq" : false
}
},
{
"pid" : {
"$eq" : "111222334"
}
},
{
"re" : {
"$eq" : false
}
}
]
},
"winningPlan" : {
"stage" : "CACHED_PLAN",
"inputStage" : {
"stage" : "FETCH",
"inputStage" : {
"stage" : "IXSCAN",
"keyPattern" : {
"pid" : 1,
"re" : 1,
"ig" : 1
},
"indexName" : "pid_1_re_1_ig_1",
"isMultiKey" : false,
"direction" : "forward",
"indexBounds" : {
"pid" : [
"[\"111222334\", \"111222334\"]"
],
"re" : [
"[false, false]"
],
"ig" : [
"[false, false]"
]
}
}
}
},
"rejectedPlans" : [ ]
}
}
},
{
"$project" : {
"pid" : true,
"tid" : true,
"nm" : true,
"c" : true,
"re" : true,
"ig" : true,
"ft" : true,
"lt" : true
}
},
{
"$sort" : {
"sortKey" : {
"c" : -1
},
"limit" : NumberLong(20)
}
},
{
"$skip" : NumberLong(0)
}
],
"ok" : 1
}