HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
MongoDB database delete syntax is as follows:
db.dropDatabase()
Delete the current database, the default for the test, you can use db command to view the current database name.
The following example we removed the database w3resource.
First, check all databases:
> show dbs local 0.078GB w3resource 0.078GB test 0.078GB
Then we switch to the database w3resource:
> use w3resource switched to db w3resource >
Delete command:
> db.dropDatabase() { "dropped" : "w3resource", "ok" : 1 }
Finally, we show dbs command through the database deleted successfully:
> show dbs local 0.078GB test 0.078GB >
Collection delete syntax is as follows:
db.collection.drop()