Create database in MongoDB

After installing the MongoDB, to use it, the first thing we need to know is: how we can create database in MongoDB. In this tutorial, I will show you how we can do that!

To create a new database in MongoDB, you will use the command as below:

This command will help us create a new database if it didn’t exist. In the case, there is a database with the same name with the database which we are creating, this command will return the existing database.

For example, I create a database, named mongodb using the MongoDB as below:

Create database in MongoDB

 

Create database in MongoDB
Đánh giá bài viết
Chia sẽ bài viết này ...Share on Facebook
Facebook
0Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Add Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.