diff options
Diffstat (limited to 'src/mongo/shell/utils.js')
-rw-r--r-- | src/mongo/shell/utils.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js index 2c48a3c24d6..41735768dd8 100644 --- a/src/mongo/shell/utils.js +++ b/src/mongo/shell/utils.js @@ -594,16 +594,21 @@ if (typeof(_useWriteCommandsDefault) == 'undefined') { _useWriteCommandsDefault = function() { return false; }; }; +if (typeof(_writeMode) == 'undefined') { + // This is for cases when the v8 engine is used other than the mongo shell, like map reduce. + _writeMode = function() { return "commands"; }; +}; + shellPrintHelper = function (x) { if (typeof (x) == "undefined") { // Make sure that we have a db var before we use it // TODO: This implicit calling of GLE can cause subtle, hard to track issues - remove? if (__callLastError && typeof( db ) != "undefined" && db.getMongo && - !db.getMongo().useWriteCommands) { + db.getMongo().writeMode == "legacy") { __callLastError = false; - // explicit w:1 so that replset getLastErrorDefaults aren't used here which would be bad. + // explicit w:1 so that replset getLastErrorDefaults aren't used here which would be bad var err = db.getLastError(1); if (err != null) { print(err); |