Set ReadPreference for mongodb in WAR file
I need to set the readpreference of mongodb as primaryPreferred in web.xml. How to do it?
I need to set the readpreference of mongodb as primaryPreferred in web.xml. How to do it?
So in the same document, it has mentioned to set that as part of configuration. So you can mention as part of your Mongo URI configration in AEM as below
In this mode the config is specified as part of the Mongo URI (See configuration). So if a user wants that reads from secondaries should prefer secondary with tag dc:ny,rack:1otherwise they go to other secondary then he can specify that via following mongouri
mongodb://example1.com,example2.com,example3.com/?readPreference=secondary&readPreferenceTags=dc:ny,rack:1&readPreferenceTags=dc:ny&readPreferenceTags=
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.