Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix(topology): ensure read preferences are translated on selection
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Feb 27, 2019
1 parent 259231e commit ebefb7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sdam/topology.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ class Topology extends EventEmitter {
callback = options;
if (typeof selector !== 'function') {
options = selector;
selector = readPreferenceServerSelector(options.readPreference);

translateReadPreference(options);
const readPreference = options.readPreference || ReadPreference.primary;
selector = readPreferenceServerSelector(readPreference);
} else {
options = {};
}
Expand Down

0 comments on commit ebefb7b

Please sign in to comment.