Database
db={"products":[{"_id":ObjectId("64d944cbc32ec6fcc466de27"),"name":"Producto 1","description":"undefined","brandId":"64d41c4983026a2b65df8479","showroomId":"64bb07419a44219522c6b63d","price":"100","quantity":"5","isForRent":"false","additionalCost":null,"size":"N/A","color":"Blanco","brand":"marca1","comments":"undefined","createdOn":1691960523001.0,"productImage":"productPhoto-1691960523078.jpeg"}],"brands":[{"_id":ObjectId("64d41c4983026a2b65df8479"),"name":"Petit Prata","emailId":"email@gmail.com","password":null,"lastLogin":null,"responsablePerson":"John Smith","subscription":null,"address":"calle 10, 13","phoneNo":"1234567890","profileImage":"brandPhoto-1691622473114.jpeg","slogan":"tttt","rol":"VIEWER","createdDate":1691622473028.0,"updatedDate":1691622473028.0,"celPhone":null,"dayOfpay":"none","isActive":true,"showroomId":"64bb07419a44219522c6b63d","comments":"yeeaahhh\nbienric\nwqev\ne","mailSchedule":"30","facebook":"facebook","twitter":"erht"}]}
Query
db.products.aggregate([{$lookup:{from:"brands",let:{brandId:{$toObjectId:"$brandId"}},pipeline:[{$match:{$expr:{$eq:["$_id","$$brandId"]}}}],as:"brandData"}}])