db.sample.find():
{_id:1, locations: [{vname: "edd", distr: "prakasam"}, {vname: "vij", distr: "krishna"}, {vname: "kakani", distr: "guntur"}]};
I want to find the locations other than vname: "vij"
My result could be
{_id: 1, locations: [{vname: "edd", distr: "prakasam"}, {vname: "kakani", distr: "guntur"}]};
I tried with the following queries but couldn't helped me out.
db.sample.find({'locations.$.vname': {$ne: 'vij'}})
It is returning entire document but I need to exclude this document.
Any Help is appreciable.