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

make sure that MongoDB server is configured to allow the external connection by firewall setting