Skip to content

Commit

Permalink
fix(list-collections): ensure default of primary ReadPreference
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Dec 4, 2017
1 parent aa5e705 commit 4a0cfeb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ Db.prototype.listCollections = function(filter, options) {
// Ensure valid readPreference
if (options.readPreference) {
options.readPreference = convertReadPreference(options.readPreference);
} else {
options.readPreference = this.s.readPreference || ReadPreference.primary;
}

// We have a list collections command
Expand Down

0 comments on commit 4a0cfeb

Please sign in to comment.