db.users.find({awards: {$elemMatch: {award:'National Medal', year:1975}}})
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
db.users.findOne({"_id": id},{awards: {$elemMatch: {award:'Turing Award', year:1977}}})
// Finds all documents that have a property named "tags"
// which has at least one array element matching "red"
db.inventory.find( { tags: "red" } )
> db.searchArrayDemo.find({EmployeeDetails:{$elemMatch:{EmployeePerformanceArea : "C", Year : 1996}}}).pretty();
> db.searchArrayDemo.find({EmployeeDetails:{$elemMatch:{EmployeePerformanceArea : "C++", Year : 1998}}}).pretty();
db.users.findOne({"_id": id},{awards: {$elemMatch: {award:'Turing Award', year:1977}}})
Mongodb find()(e.g. User.find(), Message.find() etc) returns an array