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

ReadPreference.fromOptions ignores hedge and maxStalenessSeconds options when readPreference is a string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.2
    • Component/s: None
    • Labels:
    • Documentation Changes:
      Not Needed

      Description

      > ReadPreference.fromOptions({readPreference: 'nearest', readPreferenceTags: [], hedge: {enabled: false}})
      ReadPreference {
        mode: 'nearest',
        tags: [],
        hedge: undefined,
        maxStalenessSeconds: undefined,
        minWireVersion: undefined
      }
      

      This seems like something that should be allowed according to the typescript definitions, and was reported as a bug to us because it breaks hedged read settings in mongosh.

        Attachments

          Activity

            People

            Assignee:
            neal.beeken Neal Beeken
            Reporter:
            anna.henningsen Anna Henningsen
            Implementer:
            Bailey Pearson Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: