Missing Method in Mongo Legacy Java Driver

45 Views Asked by At

Previously we were using mongo-java-driver 3.10.2 there is a getAddress() method in MongoClient derived from the super class, Mongo. We needed to switch to mongo-driver-legacy 4.11.1 to be able to work with mongo 5. But now I can not see the method getAddress() of MongoClient class. How can I find the value provided by this method ? you can see below what the method does.

enter image description here

1

There are 1 best solutions below

1
softghost On

plz try Get cluster description

client.getClusterDescription().getClusterSettings().getHosts().forEach(serverAddress -> {
                System.out.println("Server Address: " + serverAddress);
            });

Related Questions in MONGO-DRIVER-LEGACY