I am aware that mongodb allows $elemMatch, $slice and $ aggregators when it comes into returning fields from query but I'm wondering on how to return these fields that I want to be returned. Here's my data:
{_id:'abc',
content:[
{x:1,arr:['123','456'],arr2:[]},
{x:2,arr:['456','789'],arr2:[]},
{x:3,arr:['123','678'],arr2:[{y:1,z:1}]},
{x:4,arr:['123','789'],arr2:[{y:0,z:0}]}
]
}
and I want to return all objects that doesn't contain arr:['123'] and arr2:[{y:1,z:1}]
Any kind of help would be appreciated.