I have a collection with about 6k documents with a 2dsphere index in the location field, an example below:
"location" : {
"type" : "Point",
"coordinates" : [
138.576187,
-35.010441
]
}
Using the following query, I get about 450 documents returned with nscanned around 3k. Each document has a place, many places are duplicated. Distances returned from GeoJSON are in meters, and a distance multiplier of 0.000625 converts the distances to miles. To check, I expect a maximum distance of 32180000000000 to return all documents on the planet, i.e. 6000
db.x.aggregate([
{"$geoNear":{
"near":{
"type":"Point",
"coordinates":[-0.3658702,51.45686]
},
"distanceField":"distance",
"limit":100000,
"distanceMultiplier":0.000625,
"maxDistance":32180000000000,
"spherical":true,
}}
])
6000 ? . :
" geoNear , , , -".