MongoClient does not respect ReadPreference

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.0.0
    • Component/s: Command Operations
    • None
    • Environment:
      Linux 64 Bit
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the API doc is stated:

      By default, all read and write operations will be made on the primary, but it's possible to read from secondaries by changing the read preference:
      mongoClient.setReadPreference(ReadPreference.secondaryPreferred());


      However, this seems not to apply at least to the follwing methods because they are overriding the actual set ReadPreference by "ReadPreference.primary()":

      • listDatabases()
      • listDatabaseNames()
      • getDatabase(dbName).listCollections()

      This is very annoying because we want explicitly get this info from a secondary.

              Assignee:
              Unassigned
              Reporter:
              Kay Agahd
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: