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 creation syntax is as follows:
use DATABASE_NAME
If the database does not exist, create a database, or switch to the specified database.
The following example we create a database w3resource:
> use w3resource switched to db w3resource > db w3resource >
If you want to see all databases, you can use the command show dbs:
> show dbs local 0.078GB test 0.078GB >
You can see that we just created database w3resource not in the list of databases, to show it, we need to insert some data w3resource database.
> db.w3resource.insert({"name":"本教程"}) WriteResult({ "nInserted" : 1 }) > show dbs local 0.078GB w3resource 0.078GB test 0.078GB >
MongoDB in the default database to test, if you do not create a new database, the collection will be stored in the test database.