Command
db.users.deleteMany({age:30})
Explanation
Deletes multiple documents matching the filter. Useful for bulk removal of unwanted data.
Examples
Delete all cancelled orders
db.orders.deleteMany({status:'cancelled'})
db.users.deleteMany({age:30})
Deletes multiple documents matching the filter. Useful for bulk removal of unwanted data.
Delete all cancelled orders
db.orders.deleteMany({status:'cancelled'})