DEV Community

Cover image for MongoDB Setup - 2
Mysterio
Mysterio

Posted on

MongoDB Setup - 2

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...

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

https://www.mongodb.com/cloud/atlas/lp/try2-in?utm_source=google&utm_campaign=gs_apac_india_search_core_brand_atlas_desktop&utm_term=mongodb&utm_medium=cpc_paid_search&utm_ad=e&utm_ad_campaign_id=12212624347&adgroup=115749713423&gclid=CjwKCAjwh-CVBhB8EiwAjFEPGTUfIZDiTkCVAbcWgmeWObYmq3E323YrKoARzatNFufKKoQryPn3sBoCtRYQAvD_BwE

  • After signing in , you will see an interface like in the image below

Image description
Image description

  • Fill all the fields and click finish.

  • Then in the next section choose the free server option

Image description

  • Then scroll down in next section and click "create cluster".

Image description

  • 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.

Image description

  • Then click on left top button named "Project 0" and click new project

Image description

  • Then enter the project name and click "next"

Image description

  • Then click "create project"

Image description

  • Then click "Build a Database" and choose the free server again and click create

Image description

  • Then wait for few minutes to get your database ready

Image description

  • Then Click on "Browse Collections" and click on "Add my own data"

Image description

  • Enter database name and collection name , here collection is similar to Table in MySQL.

Image description

  • Then click on the Project name as shown in the Image below

Image description

  • Then Click on connect

Image description

  • Then enter your username and password which you have created in the beggining and click "create database user"

Image description

  • Then click choose a connection method

Image description

  • Click on second option "Connect your Application"

Image description

  • Then copy the link , you can see the link in the image highlighted with blue background , copy only that portion

Image description

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

Image description

  • Click on "Add IP Address"

Image description

  • Click on "Allow Access From Everywhere"

Image description

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

Discussion (3)

Collapse
magesh236 profile image
Mageshwaran

Nice one

Collapse
andrewbaisden profile image
Andrew Baisden

Good walkthrough MongoDB is a really easy database to get set up online.

Collapse
shubhamtiwari909 profile image
Mysterio Author

Thank you sir