MongoDB documents can be deleted using the operation db.collection.deleteMany().
All documents can be deleted from a MongoDB collection by using the operation db.collection.deleteMany() and passing an empty filter {}
For example, below operation deletes all the documents from the employee collection.
>db.employees.deleteMany({})
All documents that match a condition can be deleted from a MongoDB collection by using the operation db.collection.deleteMany() and passing the filter condition {
For example, below operation deletes all the documents from the employee collection who has the title 'Manager'.
> db.employees.deleteMany({ title : 'Manager' })
A single MongoDB document can be deleted using the operation db.collection.deleteOne().
For example, below operation deletes the first document having ‘title’ as ‘manager’.
> db.employees.deleteOne({ title: 'manager'})