Could not connect to any servers in your MongoDB Atlas cluster. trying to access the database from an IP that isn't whitelisted

Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you’re trying to access the database from an IP that isn’t whitelisted

My IP is set to 0.0.0.0/0.
I’m able to connect using the same connection string on MongoDB Compass, but when I use it in my Node.js project, it shows this error.

Can you post your code?

Hey,
The issue is resolved. There was some problem with the network, I guess. I changed my internet connection, and it worked.
Thank you!

1 Like