Docs HomeMongoDB Manual

Delete Documents


➤ Use the Select your language drop-down menu in the upper-right to set the language of the following examples.


Delete All Documents

Delete All Documents that Match a Condition

Delete Only One Document that Matches a Condition

Delete Behavior

Indexes

Delete operations do not drop indexes, even if deleting all documents from a collection.

Atomicity

All write operations in MongoDB are atomic on the level of a single document. For more information on MongoDB and atomicity, see Atomicity and Transactions.

Write Acknowledgement

With write concerns, you can specify the level of acknowledgement requested from MongoDB for write operations. For details, see Write Concern.