diff options
Diffstat (limited to 'src/mongo/shell/db.js')
-rw-r--r-- | src/mongo/shell/db.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js index 477dc95a60c..16c109e9cb4 100644 --- a/src/mongo/shell/db.js +++ b/src/mongo/shell/db.js @@ -1244,7 +1244,7 @@ DB.autocomplete = function(obj) { return ret; }; -DB.prototype.setSlaveOk = function(value) { +DB.prototype.setSlaveOk = function(value = true) { print( "WARNING: setSlaveOk() is deprecated and may be removed in the next major release. Please use setSecondaryOk() instead."); this.setSecondaryOk(value); @@ -1256,9 +1256,7 @@ DB.prototype.getSlaveOk = function() { return this.getSecondaryOk(); }; -DB.prototype.setSecondaryOk = function(value) { - if (value == undefined) - value = true; +DB.prototype.setSecondaryOk = function(value = true) { this._secondaryOk = value; }; |