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

MongoClient readPreferenceTags Options are not processed correctly

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.4.0
    • Affects Version/s: 4.2.1
    • Component/s: None
    • Labels:
    • 2
    • Not Needed

      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:
            alexandru.bt@gmail.com Alexandru Baetu
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: