For some reason my mongodb database is corrupted (doesn't behave as it should Error "dup key: { : null }" mongodb ), and I would like to clean it, delete all its data completely. I'm on Debian and I don't know the easiest way to do it. Thanks in advance
On linux you can use the command:
where
dbname
is the database nameThey can also write
mongo
to the console.use myDataBase
beingmyDataBase
the name of the database. Thendb.dropDataBase()
to delete it. To see the databases tryshow dbs
. All this after being in the mongo shell.