DEV Community

mohammad adnan
mohammad adnan

Posted on

2

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay