Database
[{"_id":1,"shop":1,"appId":"01","items":[{"itemId":"777"},{"itemId":"666"},]},{"_id":2,"shop":2,"appId":"01","items":[{"itemId":"666"},{"itemId":"123"},]},{"_id":3,"shop":2,"appId":"01","items":[{"itemId":"x"},]}]
Query
db.collection.aggregate({$match:{$expr:{$and:[{$eq:["$appId","01"]}]}}})