summaryrefslogtreecommitdiff
path: root/src/mongo/shell/bulk_api.js
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2014-02-26 11:25:50 -0500
committerScott Hernandez <scotthernandez@gmail.com>2014-02-26 12:11:30 -0500
commita56653e1df978f68b887788b39d053e3f88bb0ea (patch)
tree4ba0d7d3114f6edc4a924a6ed40b42632bfe3736 /src/mongo/shell/bulk_api.js
parentf4c7d400c8f938374474a37cde54e36168e60b26 (diff)
downloadmongo-a56653e1df978f68b887788b39d053e3f88bb0ea.tar.gz
SERVER-12786: add shell writeMode option
Diffstat (limited to 'src/mongo/shell/bulk_api.js')
-rw-r--r--src/mongo/shell/bulk_api.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/shell/bulk_api.js b/src/mongo/shell/bulk_api.js
index 21c5ce1e232..6418633954e 100644
--- a/src/mongo/shell/bulk_api.js
+++ b/src/mongo/shell/bulk_api.js
@@ -913,7 +913,8 @@ var _bulk_api_module = (function() {
for(var i = 0; i < batches.length; i++) {
// Execute the batch
- if(useWriteCommands) {
+ if(collection.getMongo().hasWriteCommands() &&
+ collection.getMongo().writeMode() == "commands") {
executeBatch(batches[i]);
} else {
executeBatchWithLegacyOps(batches[i]);