The intention of the query below is to pull items from the locs array, where x=2 and y=9. However items with these values remain in the array after this query.
db.myCollection.update(
{ }, //All records
{ $pull: { 'locs' : { $elemMatch : {'x' : 2 , 'y' : 9 } } } }
)
Could anyone tell me why it's not working?
Edit: Example document:
{
"_id" : ObjectId("55555555555"),
"locs" : [{
"x" : 2,
"y" : 9
}],
"v" : 99
}