$pull 删除所有匹配的文档,不仅仅只是删除一个。
db.test.insert(
{"todo":["dishes","laundry","dry cleaning"]});
db.test.update(
{},
{$pull:{"todo":"laundry"}}
);
$pull 删除所有匹配的文档,不仅仅只是删除一个。
db.test.insert(
{"todo":["dishes","laundry","dry cleaning"]});
db.test.update(
{},
{$pull:{"todo":"laundry"}}
);