[SERVER-1238] $within-query for geo location does not return all matches Created: 15/Jun/10  Updated: 12/Jul/16  Resolved: 02/Jul/10

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 1.4.3, 1.5.2
Fix Version/s: 1.5.4

Type: Bug Priority: Major - P3
Reporter: Florian Odronitz Assignee: Richard Kreuter (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X 10.6.3


Operating System: ALL
Participants:

 Description   

When querying documents using $within, in some situations some results are omitted:

Here is a test case:
> db.pos.remove()
> db.pos.save(

{ loc: [ 5000000, 900000 ], id: 1}

)
> db.pos.save(

{ loc: [ 5000000, 900000 ], id: 2}

)
> db.pos.ensureIndex(

{ loc : "2d" }

,

{ min : -21000000 , max : 21000000 }

)
> db.pos.save(

{ loc: [ 5000000, 900000 ], id: 3}

)
> db.pos.save(

{ loc: [ 5000000, 900000 ], id: 4}

)
> db.pos.find({"loc" : {"$within" :

{"$center" : [[5000000, 900000], 1.0]}

}}).count()
4
> db.pos.find({"loc" : {"$within" :

{"$center" : [[5000001, 900000], 5.0]}

}}).count()
1
> db.pos.find({"loc" : {"$within" :

{"$center" : [[5000001, 900000], 5.0]}

}}).toArray();
[

{ "_id" : ObjectId("4c173306f5d9d34a46cb7b11"), "loc" : [ 5000000, 900000 ], "id" : 4 }

]



 Comments   
Comment by Richard Kreuter (Inactive) [ 02/Jul/10 ]

Seems that 224ca4aecdde61bea54af48acf58c39994a497ca fixed this.

Comment by auto [ 01/Jul/10 ]

Author:

{'login': 'kreuter', 'name': 'Richard Kreuter', 'email': 'richard@10gen.com'}

Message: Do one more box of point checks in GeoCircleBrowse. SERVER-848, SERVER-1238
http://github.com/mongodb/mongo/commit/224ca4aecdde61bea54af48acf58c39994a497ca

Generated at Thu Feb 08 02:56:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.