I just want to remove several Objects in from my array in mongoDB using pullAll
db.collection.update({'_id': ObjectId(".....")}, { $pullAll : { 'notifications' : [{'type' : type}, {'id': id}]} })
Why is this not working? What is the correct syntax?
Update:
the document is:
{
"_id" : ObjectId("......"),
"notifications" : [ { "type" : "aaa",
"id" : "123" },
{ "type" : "bbb",
"id" : "123" },
{ "type" : "ccc",
"id" : "234" }]
}