How to connect to mongodb on remote server from spring boot?

I have a Spring boot application configured wih MongoDB.Everything worked just fine when working with mongodb on localhost.The problem is when i try to connect to mongodb on remote server i get “Exception opening socket” and “connect timed out”.
I already changed bind_ip = 127.0.0.1 to bind_ip = 0.0.0.0.
This is the config in my application.properties file:
spring.data.mongodb.uri=mongodb://user:password@remote_url/database_name

Is it a replica or a standalone DB?
What does you remote url look like

Sample from mongo doc
spring.data.mongodb.uri=mongodb://user:password@mongo1.example.com:12345,mongo2.example.com:23456/test

how can i identify if it’s a replica or a standalone ?

Can you access your remote db from shell?

You can use rs.status(),rs.conf() to know about your setup

rs.status
function() {
return db._adminCommand(“replSetGetStatus”);
}
rs.conf()
uncaught exception: Error: Could not retrieve replica set config: {
“ok” : 0,
“errmsg” : “not running with --replSet”,
“code” : 76,
“codeName” : “NoReplicationEnabled”
} :
rs.conf@src/mongo/shell/utils.js:1599:11
@(shell):1:1