Database

[{"_id":ObjectId("5d24e6e5e8b6b11536a8519b"),"message":"hello","meta":{"info":"friendly score 923","things":"cat bat dragon"}},{"_id":ObjectId("5d24e6e5e8b6b11536a8519c"),"message":"hello","meta":{"info":"confused score 622","things":"cat monkey dragon"}},{"_id":ObjectId("5e31f502d84d89c23d80c42c"),"message":"hello1","meta":{"info":"friendly score 921","things":"cat bat dragon1"}},{"_id":ObjectId("5e31f517d84d89c23d80c42d"),"message":"hello","meta":{"info":"friendly score 924","things":"cat monkey"}},{"_id":ObjectId("5e31f502d84d89c23d80c421"),"message":"hello","meta":{"info":"friendly score 925","things":"cat bat dragon"}}]

Query

db.collection.aggregate([{$match:{message:"hello"}},{$addFields:{shouldExists:{$gte:[{$indexOfCP:["$meta.things","monkey"]},0]},shouldNotExists:{$gte:[{$indexOfCP:["$meta.things","dragon"]},0]}}},{$match:{shouldExists:true,shouldNotExists:false}},{$project:{shouldExists:0,shouldNotExists:0}}])

Result