summaryrefslogtreecommitdiff
path: root/src/mongo/shell/mongo.js
diff options
context:
space:
mode:
authorKevin Albertson <kevin.albertson@10gen.com>2018-01-04 16:27:22 -0500
committerKevin Albertson <kevin.albertson@10gen.com>2018-01-31 10:25:43 -0500
commit28c18ba63785d6cbf0ae27c4d5031255b6b79b2c (patch)
tree135138f6f84a876f55b1c639e8983222d85e0a99 /src/mongo/shell/mongo.js
parente8596ec81cd0448310e40d9c2af8f8161dae3965 (diff)
downloadmongo-28c18ba63785d6cbf0ae27c4d5031255b6b79b2c.tar.gz
SERVER-32065 support retryWrites URI param in shell
Diffstat (limited to 'src/mongo/shell/mongo.js')
-rw-r--r--src/mongo/shell/mongo.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js
index 2a477659eb8..e789e284795 100644
--- a/src/mongo/shell/mongo.js
+++ b/src/mongo/shell/mongo.js
@@ -417,7 +417,11 @@ Mongo.prototype.getClusterTime = function() {
return this._clusterTime;
};
-Mongo.prototype.startSession = function startSession(options) {
+Mongo.prototype.startSession = function startSession(options = {}) {
+ // Set retryWrites if not already set on options.
+ if (!options.hasOwnProperty("retryWrites") && this.hasOwnProperty("_retryWrites")) {
+ options.retryWrites = this._retryWrites;
+ }
return new DriverSession(this, options);
};