C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MongoDB Drop DatabaseThe dropDatabase command is used to drop a database. It also deletes the associated data files. It operates on the current database. Syntax: db.dropDatabase() This syntax will delete the selected database. In the case you have not selected any database, it will delete default "test" database. To check the database list, use the command show dbs: >show dbs TheDeveloperBlogdb 0.078GB local 0.078GB If you want to delete the database "TheDeveloperBlogdb", use the dropDatabase() command as follows: >use TheDeveloperBlogdb switched to the db TheDeveloperBlogdb >db.dropDatabase() { "dropped": "TheDeveloperBlogdb", "ok": 1} Now check the list of databases: >show dbs local 0.078GB
Next TopicMongoDB Create Collection
|