I have the following object
{
"_id" : ObjectId("4b8699aa3b97dc29dd000000"),
"name" : "test",
"email" : "test",
"url" : "test",
"items" : [
{
"$ref" : "item",
"$id" : ObjectId("4b866a043b97dc22a9000001")
}
]}
How can I remove the reference from items? I have the objectid for the reference? I tried the following, which does work for normal list items but not with a reference.
db.foo.update(foo, {$pull: {'items': {'$id': ObjectId("4b866a043b97dc22a9000001") } } })