Unable to connect to mongodb on remote server

I have a spring boot application with a mongo database on localhost and everything work fine.
Now i want to deploy my application to my server and the database is on another remote server.
I changed mongod.conf file and uncommented “bindIp: #default value is”
In my application.properties file i have this:
When i run my application i get “com.mongodb.MongoSocketOpenException: Exception opening socket” caused by “Caused by: java.net.SocketTimeoutException: connect timed out”

i am aslo facing the same issue i was try to access the mongodb running in one machine through another but i am facing socket exception can anyone please guide me with this

What is the exact socket exception you are getting?