diff options
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/count_cmd.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/commands/distinct.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 13 | ||||
-rw-r--r-- | src/mongo/db/commands/mr_common.h | 1 | ||||
-rw-r--r-- | src/mongo/db/commands/pipeline_command.cpp | 5 |
5 files changed, 25 insertions, 8 deletions
diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp index 3bb4c6031f1..1164eb1e07c 100644 --- a/src/mongo/db/commands/count_cmd.cpp +++ b/src/mongo/db/commands/count_cmd.cpp @@ -163,8 +163,11 @@ public: auto viewAggCmd = OpMsgRequest::fromDBAndBody(nss.db(), viewAggregation.getValue()).body; - auto viewAggRequest = - aggregation_request_helper::parseFromBSON(nss, viewAggCmd, verbosity); + auto viewAggRequest = aggregation_request_helper::parseFromBSON( + nss, + viewAggCmd, + verbosity, + APIParameters::get(opCtx).getAPIStrict().value_or(false)); if (!viewAggRequest.isOK()) { return viewAggRequest.getStatus(); } diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index 70a710ff044..53c8497beee 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -161,8 +161,11 @@ public: auto viewAggCmd = OpMsgRequest::fromDBAndBody(nss.db(), viewAggregation.getValue()).body; - auto viewAggRequest = - aggregation_request_helper::parseFromBSON(nss, viewAggCmd, verbosity); + auto viewAggRequest = aggregation_request_helper::parseFromBSON( + nss, + viewAggCmd, + verbosity, + APIParameters::get(opCtx).getAPIStrict().value_or(false)); if (!viewAggRequest.isOK()) { return viewAggRequest.getStatus(); } diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 7e51b1538d6..32c6cdcb0b8 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -70,7 +70,11 @@ std::unique_ptr<QueryRequest> parseCmdObjectToQueryRequest(OperationContext* opC NamespaceString nss, BSONObj cmdObj, bool isExplain) { - auto qr = QueryRequest::makeFromFindCommand(std::move(cmdObj), isExplain, std::move(nss)); + auto qr = + QueryRequest::makeFromFindCommand(std::move(cmdObj), + isExplain, + std::move(nss), + APIParameters::get(opCtx).getAPIStrict().value_or(false)); if (!qr->getLegacyRuntimeConstants()) { qr->setLegacyRuntimeConstants(Variables::generateRuntimeConstants(opCtx)); } @@ -270,8 +274,11 @@ public: auto viewAggCmd = OpMsgRequest::fromDBAndBody(_dbName, viewAggregationCommand).body; // Create the agg request equivalent of the find operation, with the explain // verbosity included. - auto aggRequest = uassertStatusOK( - aggregation_request_helper::parseFromBSON(nss, viewAggCmd, verbosity)); + auto aggRequest = uassertStatusOK(aggregation_request_helper::parseFromBSON( + nss, + viewAggCmd, + verbosity, + APIParameters::get(opCtx).getAPIStrict().value_or(false))); try { // An empty PrivilegeVector is acceptable because these privileges are only diff --git a/src/mongo/db/commands/mr_common.h b/src/mongo/db/commands/mr_common.h index c3e80c11874..5e5c6dc55e7 100644 --- a/src/mongo/db/commands/mr_common.h +++ b/src/mongo/db/commands/mr_common.h @@ -36,6 +36,7 @@ #include "mongo/db/commands/map_reduce_gen.h" #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" +#include "mongo/db/pipeline/pipeline.h" namespace mongo::map_reduce_common { diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 6535d11c2b1..341c42d1aca 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -73,7 +73,10 @@ public: const OpMsgRequest& opMsgRequest, boost::optional<ExplainOptions::Verbosity> explainVerbosity) override { const auto aggregationRequest = uassertStatusOK(aggregation_request_helper::parseFromBSON( - opMsgRequest.getDatabase().toString(), opMsgRequest.body, explainVerbosity)); + opMsgRequest.getDatabase().toString(), + opMsgRequest.body, + explainVerbosity, + APIParameters::get(opCtx).getAPIStrict().value_or(false))); auto privileges = uassertStatusOK(AuthorizationSession::get(opCtx->getClient()) |