diff options
author | Ruoxin Xu <ruoxin.xu@mongodb.com> | 2021-01-19 15:34:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-30 21:50:14 +0000 |
commit | 193823453567d03d2c41e35e9dd526311c0f6f3f (patch) | |
tree | 3dc4d99ea3534ddba3fa70f942c208fc2c7d483c /src/mongo/db/commands/find_cmd.cpp | |
parent | 75832e5ba1915f93f858998f6d4205d424fff455 (diff) | |
download | mongo-193823453567d03d2c41e35e9dd526311c0f6f3f.tar.gz |
SERVER-51624 Modify query commands to enforce API version 1 behaviour
Diffstat (limited to 'src/mongo/db/commands/find_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
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 |