Query :
db.DEFAULT.find({ "bookStore.books.book.bookId":7501},{"bookStore.books.book.bookId" :1});
Collection :
{
"_id" : ObjectId("5988814feb46972540cebccd"),
"bookStore" : [
{
"books" : [
{
"book" : {
"bookId" : 7501
}
},
{
"book" : {
"bookId" : 7502
}
},
{
"book" : {
"bookId" : 7500
}
}
]
}
]
}
When I run the query, it displays all the 3 records. Is there anyway only the matching record will be displayed in the results.