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

Combine post $lookup $match on looked up field

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query 11 (03/14/16), Query 12 (04/04/16), Query 13 (04/22/16), Query 14 (05/13/16)
    • Case:

      Description

      In the scenario where the agg pipeline is:

      {$lookup:{from:"c2",localField:"foo",foreignField:"bar",as:"c2s"}},
      {$unwind:"$c2s"},
      {$match:{"c2s.f2":someValue}}
      

      we should be able to merge the query for f2:someValue into the query into "c2" as find:{bar:"$foo", f2:someValue} as a performance optimization.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benjamin.murphy Benjamin Murphy
              Reporter:
              asya Asya Kamsky
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: