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

Support $lookup with external foreign side and sub-pipeline

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL
    • QE 2022-08-08

      Here's repro script.

      var kUrl = "file://jstests/noPassthrough/coll.bson";
      var kMd = {url: kUrl};
      var pipeline = [
          {$unionWith: {external: {urls: [kMd], storageType: "local"}}},
          {$match: {a: {$lt: 10}}},
          {$lookup: {
              from: {urls: [kMd], storageType: "local"},
              localField: "a",
              foreignField: "a",
              pipeline: [{$match: {a: {$lt: 5}}}],
              as: "j"
          }},
          {$unwind: "$j"}
      ];
      
      db[1].aggregate(pipeline);
      

            Assignee:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Reporter:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: