summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/shell/assert.js6
-rw-r--r--src/mongo/shell/collection.js2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js
index ac483bc8bb5..25bc108febd 100644
--- a/src/mongo/shell/assert.js
+++ b/src/mongo/shell/assert.js
@@ -347,10 +347,10 @@ assert.writeOK = function(res, msg) {
if (!res)
errMsg = "missing first argument, no response to check"
- else if (!res.getWriteError)
+ else if (!res.getWriteConcernError) // not BulkWriteResult/SingleWriteResult.
assert.gleOK(res, msg)
else {
- if (res.getWriteError()) {
+ if (res.hasWriteErrors()) {
errMsg = "write failed with errors: " + tojson(res)
} else if (res.getWriteConcernError()) {
errMsg = "write concern failed with errors: " + tojson(res)
@@ -395,7 +395,7 @@ assert.writeError = function(res, msg) {
if (!res.err)
errMsg = "no error" + tojson(res);
} else {
- if (!(res.getWriteError() || res.getWriteConcernError()))
+ if (!(res.hasWriteErrors() || res.getWriteConcernError()))
errMsg = "no write errors : " + tojson(res);
}
if (errMsg != "" && msg)
diff --git a/src/mongo/shell/collection.js b/src/mongo/shell/collection.js
index 32ed762a8a8..b1920e33a6e 100644
--- a/src/mongo/shell/collection.js
+++ b/src/mongo/shell/collection.js
@@ -506,7 +506,7 @@ DBCollection.prototype.createIndex = function( keys , options ){
DBCollection.prototype.ensureIndex = function( keys , options ){
var result = this.createIndex(keys, options);
- if ( this._mongo.useWriteCommands() ) {
+ if ( this.getMongo().writeMode() != "legacy" ) {
return result;
}