Last updated on July 15th, 2024 at 08:00 pm

What is MongoDB & MongoDB Atlas ?

MongoDB is a popular NoSQL database that stores data in a flexible, JSON-like format. It is a document-oriented database that provides high performance, high availability, and easy scalability. MongoDB Atlas is a cloud-hosted MongoDB service that provides all the features of MongoDB without the operational overhead. It allows you to deploy, operate, and scale MongoDB databases in the cloud with just a few clicks.

When to use MongoDB Atlas

MongoDB Atlas is a fully managed cloud database service that provides all the features of MongoDB without the operational overhead. It is ideal for developers who want to focus on building applications without worrying about managing the database infrastructure. MongoDB Atlas is suitable for a wide range of use cases, including web applications, mobile applications, IoT applications, and more. It provides high availability, automatic backups, and easy scalability, making it a great choice for production applications.


Also if you are a beginner and want to get started with MongoDB, MongoDB Atlas is a great way to get started quickly without having to worry about setting up and managing a database server. You can sign up for a free account and get started with MongoDB Atlas in just a few minutes.

Finding Mongodb Connection String(for already existing account/users)

  1. Log in to your MongoDB Atlas account.
  2. Go to your Clusters page under deploymen, database section.
  3. Click on the “Connect” button for the cluster you want to connect to.
  4. When prompted to Connect to Cluster, choose the “Connect your application” option.
  5. This lets you choose the Drivers. We will pick default Node.js driver version 5.5(as of writing) or later.

Finding Mongodb Connection String(for new users)

  1. Create a new MongoDB Atlas account if you don’t have one already. You can sign up for a free account at https://www.mongodb.com/cloud/atlas.
  2. Once you have created an account and logged in, you can create a new cluster by clicking on the “Build a Cluster” button.
  3. Follow the instructions to create a new cluster. You can choose the free tier option to get started.
  4. Once the cluster is created, click on the “Connect” button to connect to the cluster.
  5. You will be prompted to whitelist your IP address to allow connections to the cluster. You can choose to whitelist your current IP address or enter a different IP address.
  6. Next, you will be prompted to create a MongoDB user. Enter a username and password for the user and click on the “Create MongoDB User” button.
  7. After creating the user, you will be given a connection string that you can use to connect to the cluster. Copy this connection string as we will need it to connect to the MongoDB database from our Node.js application.

If you want to learn about how to use MongoDB in an application check out the following articles:

How to build a REST API with NodeJS, Express and MongoDB

How to build a FullStack kids Learning app in NextJS

Checkout the Github repo for more examples with full code.

Praweg

A Curious and Creative fella with knack for coding.

Leave a Reply

Your email address will not be published. Required fields are marked *