Hi ,
I hope ,all are doing well .
I have a collection with millions of records. and i am trying to fetch using using nearSphere. but one thing that i observed that in ExecutionStats that totalKeysExamined scan is very high with respect to totalDocsExamined. My Query is given below -
db.getCollection('directorypage').find(
{
"appId": "c6979f9b230f","dirPageId": "services_1539646679172_5","status": 1,
"$or": [
{"heading": {"$regex": ".*Waverly .*","$options": "i"}},
{"summary": {"$regex": ".*Waverly .*","$options": "i"}},
{"body": {"$regex": ".*Waverly .*","$options": "i"}}
],
"loc": {
"$nearSphere": {
"$geometry": {
"type": "Point",
"coordinates": [
-85.84142,
38.130725
]
},
"$minDistance": 0,
"$maxDistance": 1609340
}
}
}).skip(0).limit(10).explain('executionStats');
and i am attaching the result of ExecutionStats in attachment section.
Is this working fine?