Database
db={"suspects":[{"_id":ObjectId("64f8d65249432809cdc3cb37"),"fullName":"John Doe -1","phoneNumber":"XXXXXXXXX","totalCriminalRecord":3},{"_id":ObjectId("64f8d6cd49432809cdc3cb38"),"fullName":"John Doe -2","phoneNumber":"XXXXXXXXX","totalCriminalRecord":5}],"lawyers":[{"_id":ObjectId("64f8d58849432809cdc3cb34"),"fullName":"John Doe -3","phoneNumber":"XXXXXXXXX","workAddress":"Address of .."},{"_id":ObjectId("64f8d5f349432809cdc3cb35"),"fullName":"John Doe -4","phoneNumber":"XXXXXXXXX","workAddress":"Address of .."}],"cases":[{"_id":ObjectId("64f8d9f549432809cdc3cb3d"),"crimeNumber":12345,"eventDate":"01/01/2023","suspects":[{"id":"64f8d65249432809cdc3cb37","note":"-- additional note --","lawyer":{"id":"64f8d58849432809cdc3cb34","note":"--additional note --"}}]}]}
Query
db.cases.aggregate([{$unwind:"$suspects"},{$lookup:{from:"suspects",let:{suspectObjId:{$toObjectId:"$suspects.id"}},pipeline:[{$match:{$expr:{$eq:["$_id","$$suspectObjId"]}}}],as:"suspects"}}])