summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/mr.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-05-11 17:36:52 -0400
committerMathias Stearn <mathias@10gen.com>2015-05-14 18:59:03 -0400
commit463d3343d559590d60cfd5c48ac98ad675d5390e (patch)
tree5ab045f64656074016c08229ae0bcc6734579e6e /src/mongo/db/commands/mr.cpp
parent22de12dd4ac510cd2a37b643eb528673f651e21b (diff)
downloadmongo-463d3343d559590d60cfd5c48ac98ad675d5390e.tar.gz
SERVER-18227 Add bypassDocumentValidation option to commands that need it
Diffstat (limited to 'src/mongo/db/commands/mr.cpp')
-rw-r--r--src/mongo/db/commands/mr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 54d971dd212..e723e533889 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/collection_catalog_entry.h"
#include "mongo/db/catalog/database_holder.h"
+#include "mongo/db/catalog/document_validation.h"
#include "mongo/db/clientcursor.h"
#include "mongo/db/commands.h"
#include "mongo/db/db.h"
@@ -1287,6 +1288,10 @@ namespace mongo {
BSONObjBuilder& result) {
Timer t;
+ boost::optional<DisableDocumentValidation> maybeDisableValidation;
+ if (shouldBypassDocumentValidationforCommand(cmd))
+ maybeDisableValidation.emplace(txn);
+
if (txn->getClient()->isInDirectClient()) {
return appendCommandStatus(result,
Status(ErrorCodes::IllegalOperation,
@@ -1569,6 +1574,10 @@ namespace mongo {
int,
string& errmsg,
BSONObjBuilder& result) {
+ boost::optional<DisableDocumentValidation> maybeDisableValidation;
+ if (shouldBypassDocumentValidationforCommand(cmdObj))
+ maybeDisableValidation.emplace(txn);
+
ShardedConnectionInfo::addHook();
// legacy name
string shardedOutputCollection = cmdObj["shardedOutputCollection"].valuestrsafe();