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

Allow $lookup to join on multiple keys

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.2.0
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:

      Description

      The Aggregation Framework $lookup stage currently only allows single key foreign key equality lookups in a joined collection. This does not allow opportunities where the uniqueness of a joined collection requires multiple keys in the joined collection.

      One of the earlier syntaxes for $lookup had the following subdocument, which is consistent with find syntax, and would naturally allow multiple key joins:

      on :

      { sourceKey1 : $foreignKey1 }

      or for multiple keys:

      on :

      { sourceKey1 : $foreignKey1, sourceKey2 : $foreignKey2 }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-query Backlog - Query Team
              Reporter:
              lparayno Lee Parayno
              Participants:
              Votes:
              13 Vote for this issue
              Watchers:
              23 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: