-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 3.6.9, 4.0.5, 4.1.7
-
Component/s: Aggregation Framework
-
None
-
Fully Compatible
-
ALL
-
Query 2019-01-14, Query 2019-01-28
When a $geoNear stage is part of a $lookup stage's pipeline, this aggregation will fail with error code 50860. Attached is a script which can be used to reproduce this error by running it from the jstests/aggregation/sources/lookup directory:
buildscripts/resmoke.py --suites='aggregation' jstests/aggregation/sources/lookup/lookup_subpipeline_geonear.js
Part of fixing this test will include making sure this works in the sharded case, and adding test coverage for $geoNear within a $lookup subpipeline. This will include testing that this works with $geoNear using a $$ variable within the query option. For example:
const pipeline = [ { $lookup: { let : {var1: "$x"}, pipeline: [ {$geoNear: {near: [0, 0], distanceField: "distance", spherical: true, query: {_id:"$$var1"},}}, ], from: "from", as: "c", } }, ];
This does not affect 4.0.
- is depended on by
-
SERVER-38995 Allow geoNear within a lookup pipeline in the sharded case
- Closed
-
SERVER-38996 Allow $text within a lookup pipeline in the sharded case
- Closed