mongodb: can't get query executor when executing geoNear aggregate -
when executing following aggregate
db.activities.aggregate([ { $geonear: { near: { coordinates: [ -73.99279 , 40.719296 ] }, distancefield: "location.calculated", spherical: true, } } ]) i getting following error
uncaught exception: aggregate failed: { "errmsg" : "exception: geonear command failed: { ok: 0.0, errmsg: \"can't query executor\" }", "code" : 16604, "ok" : 0 } when run geonear command, works fine.
db.runcommand( { geonear: "activities" , near: [ -73.99279 , 40.719296 ], spherical: true, }) any ideas doing worng ?
the problems be:
- you missing "2dsphere" index in collection
activities. - there multiple geo indexes in collection
activities
run code in mongo shell see indexes
db.activities.getindexes()
Comments
Post a Comment