Database

db={a:[{"JoinField":"this is my data"}],b:[{"FirstField":"food","SecondField":"bar","Properties":{"JoinField":"this is my data"}},{"FirstField":"food","SecondField":"bar","Properties":{"JoinField":"this is my data"}}]}

Query

db.b.aggregate([{"$group":{"_id":"$properties.joinField",FirstField:{"$addToSet":"$FirstField"},SecondField:{"$addToSet":"$SecondField"},"JoinField":{$first:"$Properties.JoinField"}}},{"$lookup":{from:"a",localField:"JoinField",foreignField:"JoinField",as:"FirstCollection"}},{"$unwind":"$FirstCollection"},{"$project":{"JoinField":1,firstField:"$FirstField",secondField:"$SecondField",}}])

Result