Database

db={collectionA:[{"id":ObjectId("63b7c24c06ebe7a8fd11777b"),"uniqueRefId":"UUID-2023-0001","products":[{"productIndex":1,"productCategory":ObjectId("63b7c24c06ebe7a8fd11777b"),"productOwners":[ObjectId("63b7c2fd06ebe7a8fd117781")]},{"productIndex":2,"productCategory":ObjectId("63b7c24c06ebe7a8fd11777b"),"productOwners":[ObjectId("63b7c2fd06ebe7a8fd117781"),ObjectId("63b7c12706ebe7a8fd117778")]},{"productIndex":3,"productCategory":"","productOwners":""}]}],collectionB:[{"_id":ObjectId("63b7c2fd06ebe7a8fd117781"),"fullname":"Jim Corbett","email":"jim.corbett@pp.com"},{"_id":ObjectId("63b7c12706ebe7a8fd117778"),"fullname":"Carry Minatti","email":"carry.minatty@pp.com"},]}

Query

db.collectionA.aggregate([{"$unwind":"$products"},{"$lookup":{"from":"collectionB","localField":"products.productOwners","foreignField":"_id","as":"products.productOwners"}},{"$group":{"_id":{id:"$id",uniqueRefId:"$uniqueRefId"},"products":{"$push":"$products"}}},{"$project":{id:"$_id.id",uniqueRefId:"$_id.uniqueRefId",products:1,_id:0}}])

Result