db.users.deleteOne({email: 'a@b.com'})

Category: Databases & SQL

db.users.deleteOne({email: 'a@b.com'})

Delete the first matching document

Removes one document; there is no undo, so run a find with the same filter first to confirm what matches. deleteMany({...}) removes all matches. Related: db.users.drop() for the whole collection.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.