MongoNetworkError: connection to <your MongoDB Atlas cluster address> closed

  • I’m using Node.js and the Mongoose library for connecting to MongoDB Atlas.
  • I have whitelisted my current IP address in the MongoDB Atlas IP whitelist settings.
  • I have double-checked my connection string and credentials, and they are correct.
  • I have tried restarting my application and verifying my network connectivity.
  • I have also tried using different versions of the MongoDB driver and Mongoose library, but the issue remains.

I would greatly appreciate any insights, suggestions, or solutions from the community to help resolve this problem. Thank you in advance for your assistance!

Hello @saka_oluwasola and welcome to the community!

Have you tried connecting with mongosh? This is the simplest health check for the network connection.

Thanks so much have tried to connecting with mongodb but I can’t be able to do it

Not mongodb … the mongosh command.

This topic was automatically closed after 180 days. New replies are no longer allowed.