db.users.deleteMany({})

Category: Databases & SQL

db.users.deleteMany({})

Delete every document in a collection

The empty filter matches everything, so this wipes all documents while keeping the collection and its indexes. Extremely destructive on production — check countDocuments first. Related: drop() removes the collection itself.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.