介绍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.

相关文章:

  • 2021-11-19
  • 2021-09-02
  • 2022-01-26
  • 2021-11-05
  • 2021-07-12
  • 2021-11-16
  • 2021-08-30
猜你喜欢
  • 2021-09-20
  • 2021-09-15
  • 2021-08-19
  • 2021-06-14
  • 2021-11-22
  • 2021-05-23
  • 2021-09-05
相关资源
相似解决方案