MongoDB mongosh
Delete
Delete Documents
We can delete documents by using the methods deleteOne()
or deleteMany()
.
These methods accept a query object. The matching documents will be deleted.
deleteOne()
The deleteOne()
method will delete the first document that matches the query provided.
deleteMany()
The deleteMany()
method will delete all documents that match the query provided.