Raja Muhammad Asher
Raja Muhammad Asher

Raja Muhammad Asher

How do you Delete a Document?

Photo by Rubaitul Azad on Unsplash

How do you Delete a Document?

Raja Muhammad Asher's photo
Raja Muhammad Asher
·Jun 17, 2022·

1 min read

The MongoDB shell provides the following methods to delete documents from a collection:

  • To delete multiple documents, use db.collection.deleteMany()

  • To delete a single document, use db.collection.deleteOne()

Sources:

Delete Documents — MongoDB Shell. mongodb.com/docs/mongodb-shell/crud/delete.

 
Share this