[SERVER-68515] Support $lookup with external foreign side and sub-pipeline Created: 02/Aug/22  Updated: 02/Aug/22  Resolved: 02/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Yoon Soo Kim Assignee: Yoon Soo Kim
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: QE 2022-08-08
Participants:

 Description   

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


Generated at Thu Feb 08 06:11:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.