MongoDB Setup - 2
Shubham Tiwari
Posted on June 26, 2022
Hello guyz today i am going to show you the second tutorial of the Series of MERN CRUD and in this tutorial i am going to show how to setup mongo db atlas.
Also check out the first tutorial where i show how to setup the MERN App folder structure and modules, then come back here to continue.
https://dev.to/shubhamtiwari909/mern-crud-setup-148a
Lets get started...
- First download mongo db from the link below https://www.mongodb.com/try/download/community
Scroll down a little bit and You will see a download option at right side where you can choose version and OS.
- After installing mongo db , open mongo db atlas from link below
- After signing in , you will see an interface like in the image below
Fill all the fields and click finish.
Then in the next section choose the free server option
- Then scroll down in next section and click "create cluster".
- Then choose a username and password for your account and click "create user" NOTE - COPY THIS USERNAME AND PASSWORD SOMEWHERE BECAUSE YOU ARE GOING TO NEED IT LATER.
- Then click on left top button named "Project 0" and click new project
- Then enter the project name and click "next"
- Then click "create project"
- Then click "Build a Database" and choose the free server again and click create
- Then wait for few minutes to get your database ready
- Then Click on "Browse Collections" and click on "Add my own data"
- Enter database name and collection name , here collection is similar to Table in MySQL.
- Then click on the Project name as shown in the Image below
- Then Click on connect
- Then enter your username and password which you have created in the beggining and click "create database user"
- Then click choose a connection method
- Click on second option "Connect your Application"
- Then copy the link , you can see the link in the image highlighted with blue background , copy only that portion
NOTE - SAVE THIS LINK SOMEWHERE BECAUSE IT WILL BE USED FOR ESTABLISHING THE CONNECTION IN EXPRESS SERVER IN NODE JS.
- Then click on "Network Security" which is on left side in the navigation links
- Click on "Add IP Address"
- Click on "Allow Access From Everywhere"
That's it , your mongo db atlas is setup and you can use the database by connecting it to the Node js Server using Express which we will cover in the next Blog
Thats it for this post, i will continue this series in the next blog where i will teach you how to connect the mongo db in Express JS and Also Create a Model/Schema for the "user" Collection.
THANK YOU FOR READING THIS POST AND IF YOU FIND ANY MISTAKE OR WANTS TO GIVE ANY SUGGESTION , PLEASE MENTION IT IN THE COMMENT SECTION.
^^You can help me by some donation at the link below Thank you👇👇 ^^
☕ --> https://www.buymeacoffee.com/waaduheck <--
Also check these posts as well
https://dev.to/shubhamtiwari909/react-hooks-usecontext-1ml2
https://dev.to/shubhamtiwari909/redux-combinereducers-mk0
https://dev.to/shubhamtiwari909/introduction-to-tailwind-best-css-framework-1gdj
Posted on June 26, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.