From a56653e1df978f68b887788b39d053e3f88bb0ea Mon Sep 17 00:00:00 2001 From: Scott Hernandez Date: Wed, 26 Feb 2014 11:25:50 -0500 Subject: SERVER-12786: add shell writeMode option --- src/mongo/shell/bulk_api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mongo/shell/bulk_api.js') 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]); -- cgit v1.2.1