Hello,
I am trying to get all the data projection with “id” field, but execution plan shows it is going for COLLSCAN.
Ideally it should consider the “_id” index. please advise, if I am missing anything here -
db.getCollection("summary").explain().aggregate([ {
"$match" : { }
},
{
"$project" : {
"_id" : NumberInt(1)
}
}])
"winningPlan" : {
"stage" : "COLLSCAN",
"direction" : "forward"
},