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

Disambiguate native and core ReadPreferences

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None

      There are currently two differing implementations of ReadPreference - one in core and one in native. They do very similar things, but are not exactly the same which leads to a number of confusing call sites in the code, and further does not allow us do things like

      if (options.readPreference instanceof ReadPreference)

      . We should remove one of the implementations (in native), and only use the one from core throughout both codebases. Also, this is needed to be able to enforce read preferences for change streams.

      Currently the ReadPreference defined in native is being exported, so this is going to potentially be a breaking change for users which needs very clear documentation.

            Assignee:
            Unassigned Unassigned
            Reporter:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: