首页 > 代码库 > Drop a database in MongoDB

Drop a database in MongoDB

http://www.linuxask.com/questions/drop-a-database-in-mongodb

Drop a database in MongoDB

Answer:

Assuming you are going to drop the `test` database in MongoDB, follow the steps below to drop (delete) it.

>  use testswitched to db test> db.dropDatabase(){ "dropped" : "test.$cmd", "ok" : 1 }
  1. Drop a collection in MongoDB
  2. Drop all tables in MySQL database
  3. Repair and compact database in MongoDB
  4. How to get the total database index size of my MongoDB
  5. Select a document in MongoDB

Drop a database in MongoDB