$pull

$pull 删除所有匹配的文档,不仅仅只是删除一个。

db.test.insert(

{"todo":["dishes","laundry","dry cleaning"]});

db.test.update(

{},

{$pull:{"todo":"laundry"}}

);

くろさきいちご
原文地址:https://www.cnblogs.com/Andy-Li/p/5881627.html