summaryrefslogtreecommitdiff
path: root/src/mongo/shell/bulk_api.js
diff options
context:
space:
mode:
authorMatt Cotter <matt.cotter@mongodb.com>2016-07-19 10:27:12 -0400
committerMatt Cotter <matt.cotter@mongodb.com>2016-08-12 16:28:15 -0400
commit517f21d8461d132496d5e5a748e4470ad33650f9 (patch)
tree673476ea7d0f0e9c62476a93358a9a3d673f3551 /src/mongo/shell/bulk_api.js
parent6adf7407a8fa4c2b5c9d623376101dbbc3c23bad (diff)
downloadmongo-517f21d8461d132496d5e5a748e4470ad33650f9.tar.gz
SERVER-25357 expose read concern setter for shell mongo object
Diffstat (limited to 'src/mongo/shell/bulk_api.js')
-rw-r--r--src/mongo/shell/bulk_api.js27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/mongo/shell/bulk_api.js b/src/mongo/shell/bulk_api.js
index 13f9f5ec25c..16eb1687f60 100644
--- a/src/mongo/shell/bulk_api.js
+++ b/src/mongo/shell/bulk_api.js
@@ -881,17 +881,22 @@ var _bulk_api_module = (function() {
// Get command collection
var cmdColl = collection._db.getCollection('$cmd');
// Bypass runCommand to ignore slaveOk and read pref settings
- result = new DBQuery(collection.getMongo(),
- collection._db,
- cmdColl,
- cmdColl.getFullName(),
- cmd,
- {} /* proj */,
- -1 /* limit */,
- 0 /* skip */,
- 0 /* batchSize */,
- 0 /* flags */)
- .next();
+ var cursor = new DBQuery(collection.getMongo(),
+ collection._db,
+ cmdColl,
+ cmdColl.getFullName(),
+ cmd,
+ {} /* proj */,
+ -1 /* limit */,
+ 0 /* skip */,
+ 0 /* batchSize */,
+ 0 /* flags */);
+ var rc = collection.getMongo().getReadConcern();
+ if (rc) {
+ cursor.readConcern(rc);
+ }
+
+ result = cursor.next();
if (result.ok == 0) {
throw new WriteCommandError(result);