diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/shell/collection.js | 4 | ||||
-rw-r--r-- | src/mongo/shell/db.js | 6 | ||||
-rw-r--r-- | src/mongo/shell/mongo.js | 4 |
3 files changed, 4 insertions, 10 deletions
diff --git a/src/mongo/shell/collection.js b/src/mongo/shell/collection.js index 20522653bc2..bf5aa3a2653 100644 --- a/src/mongo/shell/collection.js +++ b/src/mongo/shell/collection.js @@ -1322,9 +1322,7 @@ DBCollection.prototype.getSlaveOk = function() { return this.getSecondaryOk(); }; -DBCollection.prototype.setSecondaryOk = function(value) { - if (value === undefined) - value = true; +DBCollection.prototype.setSecondaryOk = function(value = true) { this._secondaryOk = value; }; 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; }; diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js index 23a2cf775f1..5beecf5646d 100644 --- a/src/mongo/shell/mongo.js +++ b/src/mongo/shell/mongo.js @@ -39,9 +39,7 @@ Mongo.prototype.getSlaveOk = function() { return this.getSecondaryOk(); }; -Mongo.prototype.setSecondaryOk = function(value) { - if (value == undefined) - value = true; +Mongo.prototype.setSecondaryOk = function(value = true) { this.secondaryOk = value; }; |