yandex
loader

please wait

  • Jai Khanna Mar-08-2019 06:34:26 AM ( 2 weeks ago )

    What's the easiest way to do this from my bash prompt?

  • Alex Wilson Mar-08-2019 06:36:12 AM ( 2 weeks ago )

    Like this:

    mongo <dbname> --eval "db.dropDatabase()"
  • Apoorva Saxena Mar-08-2019 06:40:46 AM ( 2 weeks ago )

    The best way to do it is from the mongodb console:

    > use mydb; 
    > db.dropDatabase();

    Alternatively, you can stop mongod and delete the data files from your data directory, then restart.

    Hint: you can also move the data files to a subfolder, and delete them if you're sure you no longer need them.

Please login

Similar Discussion

Recommended For You