DEV Community

Cover image for How to Create Database & Collection in MongoDB
Ulloa Silva
Ulloa Silva

Posted on

How to Create Database & Collection in MongoDB

Introduction
MongoDB is a NoSQL database solution that focuses on availability and scalability. The data is structured and stored in collections of JSON documents.
By not using a fixed data structure, MongoDB provides a comprehensive solution for high-volume storage in a modern distributed system.

Let's start with this tutorial

Step 1: You can sign up for MongoDB Atlas and create an online database for free here.

MongoDB Atlas
You can register with Google.
Google authentication

Step 2: Accept Privacy Policy & Terms of Service

Accept Privacy

Step 3: Answer the following questions according to your needs.

questions

Step 4: Deploy your database. Next, leave the default settings, this is if you are using a free account.

Settings

You can change the cluster name if you wish.

Cluster Name

Once inside, wait for the cluster to finish configuring, and then click on create user

Cluster Finish

Connect from local environment.

environment

Now you can finish by clicking on the finish button.

COngratulation

Now go to the database section and you can manage your databases.

DataBase

Press the connect button and it will show you the different types of connection.

Connection

You can use whatever you need, in my case I am going to use visual studio. This will generate the connection string for me.

connectionString

Now just copy the connection string to your project and you can connect to the database.

Top comments (0)