The latest versions of Hibernate OGM support this via the property:
hibernate.ogm.datastore.host
Here's an example of a valid value:
www.example.com, www2.example.com:123, 192.0.2.1, 192.0.2.2:123, 2001:db8::ff00:42:8329, [2001:db8::ff00:42:8329]:123
The default value is 127.0.0.1:27017. If left undefined, the default port is 27017.
There are more details in the official documentation