diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2016-10-18 15:44:28 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2016-10-18 15:44:28 -0400 |
commit | 9d4b6574d21623796fe7c76d95dcb05a91cf4eb3 (patch) | |
tree | b329888a030a4f3f3dcbb8fc038541f8b0455bc1 | |
parent | 806c7d65cc2c5f676ac3fa94a6c9f01689197fc4 (diff) | |
download | mongo-9d4b6574d21623796fe7c76d95dcb05a91cf4eb3.tar.gz |
SERVER-26638: Add `--objcheck` and `--noobjcheck` options to mongo shell.
Add flags to disable BSON validity check in client Some performance
tests are adversely affected by the BSON checking in the client.
Change default for `objcheck` to false for client.
-rw-r--r-- | src/mongo/shell/shell_options.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp index 3a2b55da126..f4f61ee6429 100644 --- a/src/mongo/shell/shell_options.cpp +++ b/src/mongo/shell/shell_options.cpp @@ -80,6 +80,24 @@ Status addMongoShellOptions(moe::OptionSection* options) { options->addOptionChaining("eval", "eval", moe::String, "evaluate javascript"); + options + ->addOptionChaining("objcheck", + "objcheck", + moe::Switch, + "inspect client data for validity on receipt (DEFAULT)") + .hidden() + .setSources(moe::SourceAllLegacy) + .incompatibleWith("noobjcheck"); + + options + ->addOptionChaining("noobjcheck", + "noobjcheck", + moe::Switch, + "do NOT inspect client data for validity on receipt") + .hidden() + .setSources(moe::SourceAllLegacy) + .incompatibleWith("objcheck"); + moe::OptionSection authenticationOptions("Authentication Options"); authenticationOptions.addOptionChaining( @@ -254,6 +272,16 @@ Status storeMongoShellOptions(const moe::Environment& params, logger::globalLogDomain()->setMinimumLoggedSeverity(logger::LogSeverity::Debug(1)); } + // `objcheck` option is part of `serverGlobalParams` to avoid making common parts depend upon + // the client options. The option is set to false in clients by default. + if (params.count("objcheck")) { + serverGlobalParams.objcheck = true; + } else if (params.count("noobjcheck")) { + serverGlobalParams.objcheck = false; + } else { + serverGlobalParams.objcheck = false; + } + if (params.count("port")) { shellGlobalParams.port = params["port"].as<string>(); } |