Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14111

Investigate changes in SERVER-34927: allow localField and foreignField with more expressive $lookup pipeline

      Description

      Downstream Change Summary

      Previously, to determine the matching documents from the joined collection, $lookup accepted either the localField and foreignField arguments to perform an equality match or a pipeline to apply to the joined collection. After this change, the localField/foreignField arguments and the pipeline/let arguments can be used together when specifying a $lookup. For examples, see the syntax doc in WRITING-7251.

      Description of Linked Ticket

      This proposes closing SERVER-29376 and instead allowing combination of both, localField and foreignField and expressive pipeline.

      {$lookup:{from:"other",
                      localField:"l",
                      foreignField:"f",
                      as:"fromOther"
                      [, pipeline: [ ... ] ]  /* optionally add a pipeline to apply *after* equality join */
      

      This allows preserving the non-expressive lookup equality semantics with additional flexibility of using anything along with it like $sort and $limit etc.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            jason.price@mongodb.com Jason Price
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              3 years, 9 weeks, 1 day ago