-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.3.2, 2.4.0, 2.4.1, 2.4.2, 2.4.3
-
Component/s: Geo
-
Environment:MongoHQ Large running MongoDB 2.4.3
-
ALL
-
when I run the geoNear command with the near parameter without specifying uniqueDocs, it should only return one document per matched location (assuming my documents have multiple locations indexed).
Instead, even not specifying uniqueDocs, it is returning the documents multiple times (as locations are matched by geoNear). This should only happen if I had explicitly specified uniqueDocs: false which I haven't.
See uniqueDocs ref: http://docs.mongodb.org/manual/reference/command/geoNear/
Here is my query (using pymongo):
resNear = db.command(SON([ ("geoNear","missions"), ("near", [float(kwargs.get("lon")),float(kwargs.get("lat"))]), ("includeLocs", True), ("spherical", True), ("maxDistance", 30000/6378137), ("distanceMultiplier", 6378137), ("query", { "status": "published", "budget": {"$gt": 0} }) ]))
my indexes for this particular collection (referring to the geo stuff are):
{ key:
{ "locations.location": "2d" }, v: 1, ns: "cashme.missions", name: "locations.location_2d" }
so either the default for uniqueDocs was documented erratically on MongoDB oficial docs or there is a problem with uniqueDocs for geoNear (or am I missing something?).
- duplicates
-
SERVER-12120 geo $near deduping is not working
- Closed