Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2124

readPreference=secondary is not respected

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.1
    • Affects Version/s: 3.3.0
    • Component/s: Core
    • Labels:
      None

      Version 3.3.0 of the Node driver appears to have a regression where readPreference is not adhered to.

      Specifying readPreference=secondary in the connection string with version 3.2.7 results in the find() operation being executed on a secondary node, however the same code with 3.3.0 sees the operation executed on the PRIMARY node.

      Connection string and options:

      var url = "mongodb://JM-METABOX:27001,JM-METABOX:27002,JM-METABOX:27003/?replicaSet=rs&readPreference=secondary";
      const client = new MongoClient(url, { useUnifiedTopology: true, useNewUrlParser: true, monitorCommands: true });
      

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            john.murphy@mongodb.com John Murphy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: