I have the following object in my database:
{
"_id": "fTgR2YtHiZBzzqF6J",
"following": [
{
"user": {
"_id": "S4dLHRJiuHoyAp26q",
"fb": {
"id": "100006681067911",
"name": "Helen Amffhajfgiaa Laubergskymanwitzescusonsteinsen"
}
},
"date": "2013-10-01T17:25:50.305Z"
},
{
"user": {
"_id": "MAyxz4Yk5F9vh9RRy",
"fb": {
"id": "100006719587007",
"name": "Mary Amfgaiehgkg Smithman"
}
},
"date": "2013-10-11T10:47:58.898Z"
}
]
}
Now I want to remove the
{
"user": {
"_id": "MAyxz4Yk5F9vh9RRy",
"fb": {
"id": "100006719587007",
"name": "Mary Amfgaiehgkg Smithman"
}
},
"date": "2013-10-11T10:47:58.898Z"
}
subdocument from the array called "following".
My query to do this looks like this:
Collection.update({"_id":"fTgR2YtHiZBzzqF6J"},
{
"$pull": {
"following": {
"user": {
"_id": "MAyxz4Yk5F9vh9RRy"
}
}
}
});
But nothing happens!
Can someone point me towards my error?