diff options
author | Kevin Albertson <kevin.albertson@10gen.com> | 2017-12-29 12:53:14 -0500 |
---|---|---|
committer | Kevin Albertson <kevin.albertson@10gen.com> | 2018-01-11 10:47:49 -0500 |
commit | 5e28f4a35229422ec48ba7611e67b414b0eeb77f (patch) | |
tree | 53f06c5ec5491bc7360396db90aa804c0fc58536 /src/mongo/shell/bulk_api.js | |
parent | 9d1f323a131ba5e3e1af79973ae79910de10a957 (diff) | |
download | mongo-5e28f4a35229422ec48ba7611e67b414b0eeb77f.tar.gz |
SERVER-31335 cmd assertions check write errors
Diffstat (limited to 'src/mongo/shell/bulk_api.js')
-rw-r--r-- | src/mongo/shell/bulk_api.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mongo/shell/bulk_api.js b/src/mongo/shell/bulk_api.js index 777779215de..a872a1e1ca3 100644 --- a/src/mongo/shell/bulk_api.js +++ b/src/mongo/shell/bulk_api.js @@ -419,14 +419,6 @@ var _bulk_api_module = (function() { this.shellPrint = function() { return this.toString(); }; - - this.toSingleResult = function() { - // This is *only* safe to do with a WriteCommandError from the bulk api when the bulk is - // known to be of size == 1 - var bulkResult = getEmptyBulkResult(); - bulkResult.writeErrors.push({code: this.code, index: 0, errmsg: this.errmsg}); - return new BulkWriteResult(bulkResult, NONE).toSingleResult(); - }; }; WriteCommandError.prototype = Object.create(Error.prototype); @@ -1210,6 +1202,7 @@ var _bulk_api_module = (function() { module.BulkWriteResult = BulkWriteResult; module.BulkWriteError = BulkWriteError; module.WriteCommandError = WriteCommandError; + module.WriteError = WriteError; module.initializeUnorderedBulkOp = function() { return new Bulk(this, false); }; @@ -1227,6 +1220,7 @@ WriteResult = _bulk_api_module.WriteResult; BulkWriteResult = _bulk_api_module.BulkWriteResult; BulkWriteError = _bulk_api_module.BulkWriteError; WriteCommandError = _bulk_api_module.WriteCommandError; +WriteError = _bulk_api_module.WriteError; /*********************************************************** * Adds the initializers of bulk operations to the db collection |