i am trying to save data in mongodb through post method and using mongodb atala with node.js but it keeps giving me an error, i provided correct connection string and correc
You Can Solve This Problem By Going into Your Network Access Panel
Then Click Add IP Address
& Then Fill 0.0.0.0/0 Then Click Confirm
Don't Do this in Production But in Development, it will Work
I had the same issue but I success to fix it. On your MongoDB account, check the IP you choose to connect your application.
If you start working on a initial IP and try to work using another IP address it won't work.
In mongoDB:
NetworkAccess/ (verify the IP you registered is the same than this your actually used). You can select : Add IP address
This is probably because the IP of your machine changes, it should not happen in production, but to fix it you need to go to the network access pannel -> Add IP Address and click on "Add this IP address" and I´s going to work, until it changes again.
Did you have this line in your index.js app.use(cors())
?
Try to delete this line and delete everything that involves cors.
If this don't work try the Mehdi Berra's solution
I had this similar problem. 'Go to network access' -> 'IP whitelist' -> you can only connect to your cluster from those IP addresses , so if your IP is not present in that list
Then Click the 'Add IP address' Button-> in there click the button 'Add your current IP address'.