Database
db={reports:[{report_id:1,name:"example report",hubId:4,dimensions:{region:"North america",country:"USA"},compName:"Amsol Inc."},{report_id:2,name:"example report",hubId:4,dimensions:{region:"North america",country:"Canada"},compName:"Amsol Inc."},{report_id:3,name:"example report",hubId:5,dimensions:{region:"North america",country:"USA",revenue:20000},compName:"Microsoft Inc."},{report_id:4,name:"example report",hubId:4,dimensions:{region:"North america",country:"Greenland"},compName:"Amsol Inc."},],company:[{company_id:1,hubId:4,dimensions:{region:"North america",country:"USA"},name:"Amsol Inc."},{company_id:1,hubId:4,dimensions:{region:"North america",country:"Canada"},name:"Amsol Inc."},{company_id:2,hubId:7,dimensions:{region:"North america",country:"USA",revenue:34555},name:"Microsoft Inc."}]}
Query
db.reports.aggregate([{$lookup:{from:"company",let:{hubId:"$hubId",dimensions:"$dimensions"},as:"companies",pipeline:[{$match:{$expr:{$and:[{$eq:["$hubId","$$hubId"]},{$setEquals:[{"$objectToArray":"$dimensions"},{"$objectToArray":"$$dimensions"}]}]}}},{$project:{_id:1}}]}},{$match:{"companies.0":{$exists:true}}},{$unset:"companies"}])