diff options
author | Mihai Andrei <mihai.andrei@10gen.com> | 2021-01-22 09:09:52 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-22 15:59:58 +0000 |
commit | 838df460cd3289084e56b7c125a1612de4f859b7 (patch) | |
tree | dffb11bba53c999ccad3fcd20b207d3577635193 /jstests/core | |
parent | 0d3ed9af628a088cfec62dc98c59f3c95cc69fb8 (diff) | |
download | mongo-838df460cd3289084e56b7c125a1612de4f859b7.tar.gz |
Revert "SERVER-52953 $geoNear does not always match coordinate given to 'near' when maxDistance is set to 0"
This reverts commit f03b0dfb195370f6ecc4616a5c9efcae97566a2f.
Diffstat (limited to 'jstests/core')
-rw-r--r-- | jstests/core/geo_near_point_query.js | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/jstests/core/geo_near_point_query.js b/jstests/core/geo_near_point_query.js deleted file mode 100644 index a2d2c051b63..00000000000 --- a/jstests/core/geo_near_point_query.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Verifies that $geoNear correctly matches the point given to the 'near' parameter when the - * 'maxDistance' parameter is set to 0. - * - * @tags: [sbe_incompatible, backport_required_multiversion] - */ -(function() { -"use strict"; -const collName = jsTestName(); -const coll = db[collName]; -coll.drop(); - -const docs = [ - {"location": {"type": "Point", "coordinates": [-90, 45.1]}}, - {"location": {"type": "Point", "coordinates": [-90.0001, 45.1]}}, - {"location": {"type": "Point", "coordinates": [-90, 45.00001]}}, - {"location": {"type": "Point", "coordinates": [-90, 45.01]}}, - {"location": {"type": "Point", "coordinates": [90, -45]}}, - {"location": {"type": "Point", "coordinates": [90.00007, -45]}}, - {"location": {"type": "Point", "coordinates": [90, 45]}}, - {"location": {"type": "Point", "coordinates": [90, 45.1]}}, - {"location": {"type": "Point", "coordinates": [90, 45.01]}}, - -]; -coll.insert(docs); - -assert.commandWorked(coll.createIndex({location: "2dsphere"})); - -for (const doc of docs) { - // We test a distance of 0 to verify that point queries work correctly as well as a small, - // non-zero distance of 0.001 to verify that the distance computation used in constructing - // an S2Cap doesn't underflow. - for (const dist of [0, 0.001]) { - const pipeline = [ - { - $geoNear: { - near: doc["location"], - maxDistance: dist, - spherical: true, - distanceField: "dist.calculated", - includeLocs: "dist.location" - } - }, - {$project: {_id: 0, location: 1}} - ]; - const result = coll.aggregate(pipeline).toArray(); - assert.eq(1, result.length, tojson(result)); - const item = result[0]; - assert.eq(doc, item); - } -} -})(); |