Greetings,
I have the following MongoDB object:
{
"_id": ObjectId("4d0e28938b012fe28754715a"),
"notifications": {
"0": {
"type": "privateMessage",
"fromUname": "Eamorr2",
"time": 1292773522,
"id": "1lfw70h789u13a1e67pv"
},
"1": {
"type": "privateMessage",
"fromUname": "Eamorr2",
"time": 1292773522,
"id": "iwoidjsoskqp23nlwof"
}
},
"toUname": "Eamorr"
}
I'm trying to delete element 0, to leave me with:
{
"_id": ObjectId("4d0e28938b012fe28754715a"),
"notifications": {
"0": {
"type": "privateMessage",
"fromUname": "Eamorr2",
"time": 1292773522,
"id": "iwoidjsoskqp23nlwof"
}
},
"toUname": "Eamorr"
}
Here's what I've tried sofar (in PHP), to no avail:
$customerNotifications->update(array('toUname'=>$uname),array('$pull'=>array('notifications'=>$key)));
But it's not working and I'm totally stuck now.
Any help much appreciated. Thanks in advance,