DEV Community

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

Posted on

2

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.

Jetbrains image

Is Your CI/CD Server a Prime Target for Attack?

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. It makes sense—CI/CD servers have access to source code, a highly valuable asset. Is yours secure? Check out nine practical tips to protect your CI/CD.

Learn more

Top comments (0)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay