I have a collection with a following data:
{
\"_id\" : ObjectId(\"4e3951905e746b3805000000\"),
\"m\" : \"hello\",
\"r\" : [{
\"_id\" : ObjectId(\"4e
It's easy, you just need to use $pull operator:
db.items.update( {},
{ $pull : { r : {"_id": ObjectId("4e39519d5e746bc00f000000")} } }, false, false )
dbh.users.update({"_id": ObjectId("4e39519d5e746bc00f000000")}, {"$unset":{"r":1}},False,False)
Try using unset
Reference: MongoDB : Update Modifier semantics of "$unset"