Database
db={"products":[{"item":"paper","instock":[{"warehouse":"A","qty":"60"},{"warehouse":"A","qty":"15"}]},{"item":"planner","instock":[{"warehouse":"A","qty":"22"},{"warehouse":"B","qty":"5"}]}]}
Query
db.products.aggregate([{$unwind:"$instock"},{$match:{$expr:{$and:[{$eq:["$instock.warehouse","A"]},{$gt:[{$toInt:"$instock.qty"},2]}]}}},{$group:{_id:"$_id",item:{$first:"$item"},instock:{$push:"$instock"}}},{$project:{_id:0}}])