mongodb/mongodb-delete-one

Delete One Document

Delete a single document from a collection

mongodb
delete
document

Command

db.users.deleteOne({name:'Alice'})

Explanation

Deletes a single document matching the filter. Useful for removing specific unwanted records.

Examples

Delete one product document

db.products.deleteOne({name:'Laptop'})