I have collection entry like that
[ { shape : [{id:1,status:true},{id:2,status:false}] }, { shape : [{id:1,status:true}] } ]
I want to fetch data which exactly match array , means contain all ele. of array.
Ex. where shape.id = [1,2] / [ {id: [1,2] } ] (any one is prefer)
then it should return only
[ { shape : [{id:1,status:true},{id:2,status:false}] } ]
So help me if is there any native mongodb query .
Thanks
--ND
Here is much simpler query;
db.shapes.find({'shape.id':{$all:[1,2]},shape:{$size:2}});