diff options
Diffstat (limited to 'src/mongo/shell/mongo.js')
-rw-r--r-- | src/mongo/shell/mongo.js | 6 |
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); }; |