MongoDB 8 · Backup and administration
Drop the current database
Delete the current database.
db.dropDatabase()
Caution: Permanently deletes every collection in the current database. Check which database you are on with db.
Official MongoDB 8 documentation
More backup and administration commands
- Back up a database
- Restore a dump
- Export a collection to JSON
- Import JSON
- Check database size
- Create a user
All backup and administration commands · MongoDB 8 cheatsheet