I have this data
{
"_id": ObjectId("575e66a4c2b503944800002b"),
"phone": "201-780-8497",
"orders": [
"1961682636",
"43243242"
]
}
I want to remove order '43243242' where phone is "201-780-8497"
Here is my PHP code
$collection->update(
array('phone'=>$doc['phone']),
array('$pull' => array('orders' => array('1961682636'), array('safe' => TRUE))
));
This does nothing, no error, no exception.
Where I am getting wrong?