diff options
author | Matt Cotter <matt.cotter@mongodb.com> | 2016-04-27 10:56:47 -0400 |
---|---|---|
committer | Matt Cotter <matt.cotter@mongodb.com> | 2016-04-29 14:50:44 -0400 |
commit | 02e0d1ee8f77ab6311d37e4ea29cacc706ff7e00 (patch) | |
tree | bbc9f02b1d9aac2bd249c8e01a054ac897e8df5b /src/mongo/shell/bulk_api.js | |
parent | 860de6296a9b6da76c3938ab2bc367fe2db5f976 (diff) | |
download | mongo-02e0d1ee8f77ab6311d37e4ea29cacc706ff7e00.tar.gz |
SERVER-23579 WriteConcern can be called on objects
Previously, to make a WriteConcer({j:true}), it had to be "new"ed.
Now WriteConcern can be called on a write concern object.
Diffstat (limited to 'src/mongo/shell/bulk_api.js')
-rw-r--r-- | src/mongo/shell/bulk_api.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/shell/bulk_api.js b/src/mongo/shell/bulk_api.js index 0afe20a9785..84dc583b1ea 100644 --- a/src/mongo/shell/bulk_api.js +++ b/src/mongo/shell/bulk_api.js @@ -43,8 +43,11 @@ var _bulk_api_module = (function() { */ var WriteConcern = function(wValue, wTimeout, jValue) { - if (!(this instanceof WriteConcern)) - return new WriteConcern(wValue, wTimeout, jValue); + if (!(this instanceof WriteConcern)) { + var writeConcern = Object.create(WriteConcern.prototype); + WriteConcern.apply(writeConcern, arguments); + return writeConcern; + } var opts = {}; if (typeof wValue == 'object') { |