介绍delete的方法

MongoDB provides the following methods to delete documents of a collection:

db.collection.deleteOne()

Delete at most a single document that match a specified filter even though multiple documents may match the specified filter.

New in version 3.2.

db.collection.deleteMany()

Delete all documents that match a specified filter.

New in version 3.2.

db.collection.remove() Delete a single document or all documents that match a specified filter.

Additional Methods

The following methods can also delete documents from a collection:

See the individual reference pages for the methods for more information and examples.

posted on 2017-08-07 10:52  懒睡的猫熊  阅读(279)  评论(0编辑  收藏  举报