DEV Community

mohammad adnan
mohammad adnan

Posted on

connect MongoDB to Node.js

Don't get too confuse while connecting MongoDB
to Node.js because people use different ways to connect it

  1. after intalling dependencies and making .env file mention your connection link of mongodb and port in env file this way will also work when you deploy your project. just remove the mongodb compass link to mongodb atlas link.because on onrender and heroku you have to mention in in enviroment variables separately and below pic will help you to solve your doubts

Image description

Top comments (0)