[SERVER-52953] $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0 Created: 19/Nov/20  Updated: 29/Oct/23  Resolved: 02/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.4.5, 4.0.24, 4.2.14

Type: Bug Priority: Major - P3
Reporter: Mihai Andrei Assignee: Mihai Andrei
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
Related
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Steps To Reproduce:

See linked script 'quarters.js' in HELP-20040.

Sprint: Query 2020-12-14, Query 2020-12-28, Query 2021-01-11, Query 2021-01-25, Query Execution 2021-02-22, Query Execution 2021-03-08
Participants:
Case:
Linked BF Score: 50

 Description   

See the linked script in HELP-20040. Essentially, when performing an aggregation using a $geoNear stage of the form:

{
$geoNear: {
near: { type: "Point", coordinates: <coordinate> },
maxDistance: 0,
spherical: true
}

where 'coordinate' is a lat-long coordinate that exists in some document in the collection being aggregated, the $geoNear stage will not always match the given coordinate.



 Comments   
Comment by Githook User [ 08/Apr/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0

(cherry picked from commit 72bf0123af2075be083c6d6ad1a65658e0d499b1)
Branch: v4.0
https://github.com/mongodb/mongo/commit/bbf60c1bcbc5722870edb7327fc59d4025a7644e

Comment by Githook User [ 09/Mar/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0
Branch: v4.2
https://github.com/mongodb/mongo/commit/72bf0123af2075be083c6d6ad1a65658e0d499b1

Comment by Githook User [ 08/Mar/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0

(cherry picked from commit b33f2292ab02214d5626edcd557b3a9f3c09a183)
Branch: v4.4
https://github.com/mongodb/mongo/commit/bc2d8020ee393b5da3224d9974e93a8773305443

Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0
Branch: master
https://github.com/mongodb/mongo/commit/b33f2292ab02214d5626edcd557b3a9f3c09a183

Comment by Githook User [ 22/Jan/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: Revert "SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0"

This reverts commit f03b0dfb195370f6ecc4616a5c9efcae97566a2f.
Branch: master
https://github.com/mongodb/mongo/commit/838df460cd3289084e56b7c125a1612de4f859b7

Comment by Githook User [ 12/Jan/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0
Branch: master
https://github.com/mongodb/mongo/commit/f03b0dfb195370f6ecc4616a5c9efcae97566a2f

Generated at Thu Feb 08 05:29:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.