DEV Community

gokuthecoder
gokuthecoder

Posted on

How To Connect Database Professionally

we are use online MongoDB database

Fist of all we create our connection uri from monogdb

  1. Go to mongoDB

  2. signup & create Project

  3. click on connect and copy URI string

click on connect

my wish is go with comapss
now i copy connection String


Now we are go to our code and see what is good practise to connect server to mongoDB

Basically we have to approach to connect with database

  1. write code in Entry point (index.js)
  2. create a seprate file and write code on that

write code in Entry point (index.js)

`;(()=>{

})()`

Top comments (0)