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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.2.2
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      > 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.

              Assignee:
              Bailey Pearson
              Reporter:
              Anna Henningsen
              Neal Beeken
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: