How to connect MongoDB Atlas | Cloud Database

How to connect MongoDB Atlas 

connect MongoDB Atlas

What is MongoDB Atlas? 

MongoDB Atlas is a multi-cloud database service provided by the same company that provides MongoDB databases. It is a fully managed cloud database that is able to handle all the complexity of CRUD operations in the cloud. It offers free storage of up to 5 GB and you can choose from various cloud service providers like AWS, Google Cloud, and Azure.

You may also like:

  • Google Account.
  • Stable Internet.

How to connect to MongoDB Atlas using Node and Express

How to setup MongoDB Atlas

To connect to MongoDB Atlas and use it in your project follow the given instructions:

1. Open the official website from here and sign up with your Google account or if you already have an account then sign in to MongoDB Altas.

connect MongoDB Atlas

2. Now on the home page click on the New Project button.

connect MongoDB Atlas

3. Give a name to your project and click on the next button.

connect MongoDB Atlas

4. If you have team members then add them to the project or simply click on the create project button.

connect MongoDB Atlas

5. Now select the database access tab to your left sidebar (it is not mandatory to configure database and network access first.) and click on the  Add New Database User button.

connect MongoDB Atlas

6. On the Add New Database User page, give the user name, password (make sure to copy and paste the password as we will need it afterward), and role (select: read and write to any database). After that click on the Add User button.

connect MongoDB Atlas

7. After creating a user, select the Network Access tab on your left sidebar and click on Add IP Address button.

connect MongoDB Atlas

8. As we are on the development side, select the Allow Access From Anywhere option and then click on confirm button.

connect MongoDB Atlas

9. Now from the sidebar choose the database option and click on the Build a Database button.

connect MongoDB Atlas

10. Now select the shared cluster aka the free one and click on the create button

connect MongoDB Atlas

11. On the Create a Shared Cluster page, select the service provider and the region of your choice and click on the Create Cluster button.

connect MongoDB Atlas

12. Now on the Security Quickstart page, scroll down and click on the Finish and Close button (you can also change the configuration afterward).

connect MongoDB Atlas

13. After that click on Go to Database button.

connect MongoDB Atlas

14. At this moment, we have successfully created our MongoDB Atlas database. Now it's time to connect it, so click on the Connect button.

connect MongoDB Atlas

15. Now click on the Connect your application option.

connect MongoDB Atlas

16. Here you have your connection string. Copy and paste this string to your project codebase and replace the <password> with you password that you have copied in step 6.

connect MongoDB Atlas

17. To view your data in your database go to the dashboard and click on Browse Collections.

connect MongoDB Atlas

18. Here you will get all your collections.

connect MongoDB Atlas

This is how you can connect MongoDB Atlas with your project.

I hope this article was helpful to you.
Thank you.

Comments

Popular posts from this blog

How to install MySQL Workbench | Windows 10

How to install C and C++ | MinGW | Windows 10

How to install Python on Windows 10