xxxxxxxxxx
// unwind & bring the internal array to root level
db.collection.aggregate([
{
$lookup: {
localField: "_id",
from: "foreignCollection",
foreignField: "foreign_id",
as: "internalArray",
},
{ $unwind: "$internalArray" },
{ "$replaceRoot": { "newRoot": "$internalArray" } }
])