How to connect MongoDB Atlas | Cloud Database
How to 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.
2. Now on the home page click on the New Project button.
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.
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.
7. After creating a user, select the Network Access tab on your left sidebar and click on Add IP Address button.
8. As we are on the development side, select the Allow Access From Anywhere option and then click on confirm button.
9. Now from the sidebar choose the database option and click on the Build a Database button.
10. Now select the shared cluster aka the free one and click on the create button
13. After that click on Go to Database button.
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.
15. Now click on the Connect your application option.
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.
17. To view your data in your database go to the dashboard and click on Browse Collections.
This is how you can connect MongoDB Atlas with your project.
I hope this article was helpful to you.
Thank you.



















Comments
Post a Comment