Skip to main content

How do you Delete a Document?

Published 1 min readMarkdown
Part of seriesMongoDB
How do you Delete a Document?

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. www.mongodb.com/docs/mongodb-shell/crud/delete.

About the author

  • Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, MySQL, MongoDB. Love collaborating & making a difference

No comments yet. Be the first to comment.

More from this blog