Database

db={"Portfolio":[{"_id":"fjkhjkdshjkhkdsgfsadhfghgdsa","Name":"Alex's Portfolio","Stocks":[{"StockId":5454125454796,"Quantity":NumberInt(30),"InvestedValue":"4124"},{"StockId":5745454554541,"Quantity":NumberInt(6),"InvestedValue":"3048"}],"MutualFunds":[{"MutualFundId":472546545646564,"Quantity":"12","InvestedValue":"5233"}]}],"Securities":[{"_id":"d5043755-ff4d-47da-bbff-df838a79df3b","StockId":5454125454796,"Name":"AB Industries Ltd.","LastPrice":"5.70","LastPriceChange":"0.27"},{"_id":"49224732-f380-4e6f-a933-6fdb5b42107f","StockId":5745454554541,"Name":"AB Industries 2 Ltd.","LastPrice":"5.70","LastPriceChange":"0.27"}],"MutualFunds":[{"_id":"3d8a4baa-34e6-4e5b-b782-ec4eda213fc9","MfId":472546545646564,"Name":"AB Industries Bond","LastNAV":"1036.747","LastNAVChange":"0.3298",}]}

Query

db.Portfolio.aggregate([{"$lookup":{"from":"Securities","localField":"Stocks.StockId","foreignField":"StockId","as":"Securities"}},{"$lookup":{"from":"MutualFunds","localField":"MutualFunds.MutualFundId","foreignField":"MfId","as":"Mfs"}},{$set:{"Securities":{$map:{input:"$Securities",as:"s",in:{$mergeObjects:["$$s",{$first:{$filter:{input:"$Stocks",cond:{$eq:["$$s.StockId","$$this.StockId"]}}}}]}}},"Mfs":{$map:{input:"$Mfs",as:"m",in:{$mergeObjects:["$$m",{$first:{$filter:{input:"$MutualFunds",cond:{$eq:["$$m.MutualFundId","$$this.MfId"]}}}}]}}}}},{$unset:["Stocks","MutualFunds","Securities._id","Mfs._id","Mfs.MutualFundId"]}])

Result