summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/copydb.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/copydb.cpp
parent22de12dd4ac510cd2a37b643eb528673f651e21b (diff)
downloadmongo-463d3343d559590d60cfd5c48ac98ad675d5390e.tar.gz
SERVER-18227 Add bypassDocumentValidation option to commands that need it
Diffstat (limited to 'src/mongo/db/commands/copydb.cpp')
-rw-r--r--src/mongo/db/commands/copydb.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp
index 415f3b396c7..1d5a5b590b0 100644
--- a/src/mongo/db/commands/copydb.cpp
+++ b/src/mongo/db/commands/copydb.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/auth/resource_pattern.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/catalog/collection.h"
+#include "mongo/db/catalog/document_validation.h"
#include "mongo/db/cloner.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/copydb.h"
@@ -128,6 +129,10 @@ namespace mongo {
string& errmsg,
BSONObjBuilder& result) {
+ boost::optional<DisableDocumentValidation> maybeDisableValidation;
+ if (shouldBypassDocumentValidationforCommand(cmdObj))
+ maybeDisableValidation.emplace(txn);
+
string fromhost = cmdObj.getStringField("fromhost");
bool fromSelf = fromhost.empty();
if ( fromSelf ) {