My node app gives me this message
\"Could not connect to any servers in your MongoDB Atlas cluster. Make sure your current IP address is on your Atlas cluster\'s IP whitelist\"
At times, it may be due to system settings as well.
In my case it was server system's date & time, it was not updated to current date & time settings, hence the connection to db from the server was refused. Updated the same, and restart the server, connection was successful.