I need to pull all the objectids inside the array of each documents, field variables is an array in the collection .
db.users.variables.update({},{$pull:{variables:{$in:invalidVariables}}},
{safe:true, multi:true, upsert:false});
This is the query I am using. But it pulls all the values from the single document.I have mentioned multi true also. What can be a issue.Please help me