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

Allow $lookup to join on multiple keys

    • Query
    • Fully Compatible

      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 }

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            lparayno Lee Parayno
            Votes:
            13 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: