Details
-
Bug
-
Status: Closed
-
Critical - P2
-
Resolution: Fixed
-
3.6.9, 4.0.5, 4.1.7
-
None
-
Fully Compatible
-
ALL
-
Query 2019-01-14, Query 2019-01-28
Description
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.
Attachments
Issue Links
- 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
-