Database

db={"sales":[{"brand_id":"A","price":500},{"brand_id":"A","price":700},{"brand_id":"B","price":1500},{"brand_id":"C","price":100},{"brand_id":"D","price":400},{"brand_id":"D","price":600},{"brand_id":"D","price":200}],"brands":[{brand_id:"A",brand_name:"abc",threshold:1000},{brand_id:"B",brand_name:"hef",threshold:600},{brand_id:"D",brand_name:"xyz",threshold:310}]}

Query

db.brands.aggregate([{"$lookup":{"from":"sales","localField":"brand_id","foreignField":"brand_id","as":"salesLookup"}},{"$set":{"total_sales":{$sum:"$salesLookup.price"}}},{"$match":{$expr:{$gte:["$total_sales","$threshold"]}}}])

Result