xxxxxxxxxx
db.inventory.find( { tags: {$all: ["red", "blank"] } } )// to search even if other elements exist in the array
db.inventory.find( { tags: ["red", "blank"] } )// to search only if other elements does not exist in the array
xxxxxxxxxx
db.users.find({awards: {$elemMatch: {award:'National Medal', year:1975}}})
xxxxxxxxxx
// Finds all documents that have a property named "tags"
// which has at least one array element matching "red"
db.inventory.find( { tags: "red" } )
xxxxxxxxxx
db.users.findOne({"_id": id},{awards: {$elemMatch: {award:'Turing Award', year:1977}}})