MongoDB – Create Database:

Database in MongoDB is nothing but a logical storage of all collections created. A mongoDB server can have multiple databases.

By Default, when we install the mongoDB we will have 2 databases. To check the databases below is the command.

There is no command for creating database in specific for mongoDB. We need to define the database name which you want to use. Let us use a database called imongo.

Let us create a collection called students.
syntax:db.createCollection() to create collection manually

Now, Check the database name by giving the below command.

You can verify the Database you are in currently. Use the below command for the same.