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

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

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.9.0
    • manual, Server
    • None
    • 5
    • ServerDocs2020: Feb2 - Feb9, ServerDocs2020: Feb9 - Feb16, ServerDocs2020: Feb16 - Feb23, ServerDocs2020: Feb23 - Mar2
    • true

    Description

      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.)

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                1 year, 23 weeks, 6 days ago