Database

db={"external_S_P_FLAT_main_api":[{"_id":{"$oid":"654c6a594d0867aef588674d"},"data.pricing.material":"TG11","data.pricing.controlling_area":"AJ00","data.pricing.cost_center":"DE000001"},{"_id":{"$oid":"654c6a594d0867aef588674e"},"data.pricing.material":"TG12","data.pricing.controlling_area":"AJ00","data.pricing.cost_center":"DE000002"},{"_id":{"$oid":"654c6a594d0867aef588674f"},"data.pricing.material":"TG14","data.pricing.controlling_area":"AJ00","data.pricing.cost_center":"DE000003"},{"_id":{"$oid":"654c6a594d0867aef5886750"},"data.pricing.material":"TG2341","data.pricing.controlling_area":"AJ00","data.pricing.cost_center":"DE000004"}],"external_S_C_FLAT_main_api":[{"_id":{"$oid":"654c6a594d0867aef5886751"},"data.costcenter.controlling_area":"AJ00","data.costcenter.cost_center":"DE000001","data.costcenter.valid_from_date":"2023-09-12","data.costcenter.long_description":"CC DE000001 - 3rd"},{"_id":{"$oid":"654c6a594d0867aef5886752"},"data.costcenter.controlling_area":"AJ00","data.costcenter.cost_center":"DE000002","data.costcenter.valid_from_date":"2022-03-02","data.costcenter.long_description":"CC DE000002 - 1st"},{"_id":{"$oid":"654c6a594d0867aef5886753"},"data.costcenter.controlling_area":"AJ00","data.costcenter.cost_center":"DE000003","data.costcenter.valid_from_date":"2023-10-25","data.costcenter.long_description":"CC DE000003 - 1st"},{"_id":{"$oid":"654c6a594d0867aef5886754"},"data.costcenter.controlling_area":"AJ00","data.costcenter.cost_center":"DE000004","data.costcenter.valid_from_date":"2023-10-25","data.costcenter.long_description":"CC DE000004 - 2nd"}]}

Query

db.external_S_P_FLAT_main_api.aggregate([{"$lookup":{from:"external_S_C_FLAT_main_api",let:{let_data__pricing__controlling_area:{$getField:"data.pricing.controlling_area"},let_data__pricing__cost_center:{$getField:"data.pricing.cost_center"}},pipeline:[{"$match":{"$expr":{"$and":[{"$eq":[{$getField:"data.costcenter.controlling_area"},"$$let_data__pricing__controlling_area"]},{"$eq":[{$getField:"data.costcenter.cost_center"},"$$let_data__pricing__cost_center"]}]}}}],as:"from_external_S_C_FLAT_main_api"}},{"$project":{_id:0}}])

Result