Discussion:
[mongodb-dev] Getting Exception when trying to execute listDabses command on secondery member
majeed said
2018-01-11 09:19:26 UTC
Permalink
Hi,

i trying to connect to a secondery member in a replicaSet using the driver
version 3.6.1:
im getting the exception "java MongoNotPrimaryException: The server is not
the primary and did not execute the operation"

with older versions of driver 3.4.2 there was no problem:
code in java :

ListDatabasesIterable<Document> listDatabases = mongoClient.listDatabases();

for (Document dbDoc : listDatabases) {
//....do something

}


is there any way to solve this issue? maybe any configuration in the
replicaset?

Best Regards,
Majeed
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/859d56d2-a4ff-45b2-9f7f-8dcc6a33a37a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...