我正在使用mongo查询优化,并使用了explain函数进行聚合,但是它仅返回默认的queryPlanner对象,我想获取executeStats对象,但是我没有得到,请帮帮我。
查询和输出:-
db.users.explain('executionStats').aggregate([
{
$match:{
"ethinicity":"Asian"
}
}
])
{
"stages" : [
{
"$cursor" : {
"query" : {
"ethinicity" : "Asian"
},
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "MWM.users",
"indexFilterSet" : false,
"parsedQuery" : {
"ethinicity" : {
"$eq" : "Asian"
}
},
"winningPlan" : {
"stage" : "COLLSCAN",
"filter" : {
"ethinicity" : {
"$eq" : "Asian"
}
},
"direction" : "forward"
},
"rejectedPlans" : []
}
}
}
],
"ok" : 1.0
}