Render deployment db connection issue

I am using render to deploy the backend of my app.I am using mongoDB atlas’s cluster to store data.When I m trying to connect to db in vscode, no issue but when I deploy it on render , connection fails.

I have updated my Ip address , but still issue remains. How to solve it ?

Try to allow access from anywhere to see if it makes a difference. If it does then it means you have to specify a different IP than the one you use to