我的数据库中有以下对象:
{
"_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"
}
]
}
现在我想删除
{
"user": {
"_id": "MAyxz4Yk5F9vh9RRy",
"fb": {
"id": "100006719587007",
"name": "Mary Amfgaiehgkg Smithman"
}
},
"date": "2013-10-11T10:47:58.898Z"
}
来自称为“以下”的数组的子文档。
我执行此操作的查询如下所示:
Collection.update({"_id":"fTgR2YtHiZBzzqF6J"},
{
"$pull": {
"following": {
"user": {
"_id": "MAyxz4Yk5F9vh9RRy"
}
}
}
});
但是什么也没有发生!
有人可以指出我的错误吗?