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

Investigate NODE-3813 - MongoClient readPreferenceTags Options are not processed correctly

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • 1
    • Not Needed

      NODE-3813 Description

      What problem are you facing?

      On mongodb@3 we used the "readPreferenceTags" set using th options param of the MongoClient. It was an array: ex:

      MongoClient( uri, { "readPreferenceTags" : [{"dc" : "irl.amz"}]})

      After updating the driver to mongodv@4.2.1, tags are processed correctly. 

      What driver and relevant dependency versions are you using?

      mongodb@4.2.1

      Steps to reproduce?

      await (new MongoClient(        URI,        {            readPreference : "nearest",            readPreferenceTags : [{"dc":"irl.amz"}]        }    ).connect());
      

      Put a breakpoint in connection_string.js at line 790

      Observe that the readPreferenceTag array is populated with an empty object: {}. 

      That happens because the transform function gets the tags as an Array of Array of objects, and not Array of objects, as it should.

       

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: