[SERVER-79226] Accuracy differences in geoNear aggregation between mongod 5.0 and 6.0 Created: 22/Jul/23 Updated: 02/Nov/23 Resolved: 02/Nov/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.0.8 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | 罗震宇 N/A | Assignee: | Backlog - Triage Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Server Triage
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
The results of geoNear example are different on mongo 5.0 and 6.0. 9.539931676365992 against 9.539931674131209 https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/ Therefore, some unit test failed.
Result of mongo 5.0.17: [{"_id": 2, "name": "Sara D. Roosevelt Park", "category": "Parks", "location": {"type": "Point", "coordinates": [-73.9928, 40.7193]}, "dist": {"calculated": 9.539931676365992, "location": {"type": "Point", "coordinates": [-73.9928, 40.7193]}}}]
Result of mongo 6.0.8: [{"_id": 2, "name": "Sara D. Roosevelt Park", "location": {"type": "Point", "coordinates": [-73.9928, 40.7193]}, "category": "Parks", "dist": {"calculated": 9.539931674131209, "location": {"type": "Point", "coordinates": [-73.9928, 40.7193]}}}] |
| Comments |
| Comment by Edwin Zhou [ 02/Nov/23 ] |
|
Hi lzy@luozy.cn, Thank you for your report and your patience on this issue. I also appreciate the details that you've provided. After further investigation, it appears this ticket duplicates
I've closed this ticket as a duplicate to Kind regards, |
| Comment by 罗震宇 N/A [ 25/Jul/23 ] |
|
yuan.fang@mongodb.com Just use the example in MongoDB document. https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/#-geonear--aggregation- Reproducedb.places.insertMany( [ , , , db.places.createIndex( { location: "2dsphere" } ) db.places.aggregate([ , MongoDB 5.0.17[ { _id: ObjectId("64bf846fb1c9448e80a6cece"), name: 'Sara D. Roosevelt Park', location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] }, category: 'Parks', dist: { calculated: 0.9539931676365992, location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] }} } ] MongoDB 6.0.8[ { _id: ObjectId("64bf838e534317ffa0f4f161"), name: 'Sara D. Roosevelt Park', location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] }, category: 'Parks', dist: { calculated: 0.9539931674131209, location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] }} } ] |
| Comment by Yuan Fang [ 24/Jul/23 ] |
|
Hi lzy@luozy.cn , Thank you for your report. I understand that you have noticed inconsistent results with the $geoNear aggregation in versions v5.0.x and v6.0.8. Could you provide more information to help us in reproducing the issue? Specifically, we would appreciate it if you could provide the following:
Regards,
|