Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38716

fix $geoNear and $text within $lookup sub-pipeline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 3.6.9, 4.0.5, 4.1.7
    • Fix Version/s: 4.1.8
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      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

            Activity

              People

              Assignee:
              brigitte.lamarche Brigitte Lamarche (Inactive)
              Reporter:
              brigitte.lamarche Brigitte Lamarche (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: