Not getting connect with database showing error whitelist

Connection attempt failed: 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. Make sure your current IP address is on your Atlas cluster’s IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/

The URL is getting Connected in Compass And mongosh

Trying to solve this error by doing this thing then also its not work

  • Adding IP to network both for everyone and specific IP also
  • Checking in Task Manager the MongoDB services is Running
  • By Using Mobile Hotspot and different Wi-Fi

Hi @Rohit_Yadav2 , where are you seeing this error? In your post, it says

The URL is getting Connected in Compass And mongosh

Are you getting this error connecting from code running elsewhere?