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

Allow $expr or $$field in the $geoNear stage

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Aggregation Framework
    • Labels:
      None

      Description

      When trying to use a $lookup with pipeline and a $geoNear stage, there is no way to pass an argument in the let field into the $geoNear stage.

      e.g.

      { 
                  "$lookup" : {
                      "from" : "regions", 
                      "let" : {
                          "point" : "$location"
                      }, 
                      "pipeline" : [
                          {
                              "$geoNear" : {
                                  "spherical" : true, 
                                  "maxDistance" : 10000.0, 
                                  "distanceField" : "distance", 
                                  "uniqueDocs" : true, 
                                  "near" : "$$point"
                              }
                          }
                      ], 
                      "as" : "regions"
                  }
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-query Backlog - Query Team
              Reporter:
              travis@bryx.com Travis Brown
              Participants:
              Votes:
              15 Vote for this issue
              Watchers:
              25 Start watching this issue

                Dates

                Created:
                Updated: