summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_find_cmd.h
diff options
context:
space:
mode:
authorSophia Tan <sophia_tll@hotmail.com>2022-08-17 21:59:59 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-23 19:04:14 +0000
commitcd1b7ce13eb583946482b5eeba3b58c0ad308d16 (patch)
tree3a713da288d0988f57281bfcb54a3ba9a4c586df /src/mongo/s/commands/cluster_find_cmd.h
parent35f5a6ea3fdbddccb2f08b1f63fad64066ba605e (diff)
downloadmongo-cd1b7ce13eb583946482b5eeba3b58c0ad308d16.tar.gz
SERVER-68421 Remove CommandHelper::parseNsCollectionRequired(StringData dbname, const BSONObj& cmdObj)
Diffstat (limited to 'src/mongo/s/commands/cluster_find_cmd.h')
-rw-r--r--src/mongo/s/commands/cluster_find_cmd.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/s/commands/cluster_find_cmd.h b/src/mongo/s/commands/cluster_find_cmd.h
index 899cba75722..5c4dca0cd78 100644
--- a/src/mongo/s/commands/cluster_find_cmd.h
+++ b/src/mongo/s/commands/cluster_find_cmd.h
@@ -68,7 +68,7 @@ public:
std::unique_ptr<CommandInvocation> parse(OperationContext* opCtx,
const OpMsgRequest& opMsgRequest) override {
// TODO: Parse into a QueryRequest here.
- return std::make_unique<Invocation>(this, opMsgRequest, opMsgRequest.getDatabase());
+ return std::make_unique<Invocation>(this, opMsgRequest);
}
AllowedOnSecondary secondaryAllowed(ServiceContext* context) const override {
@@ -97,10 +97,10 @@ public:
class Invocation final : public CommandInvocation {
public:
- Invocation(const ClusterFindCmdBase* definition,
- const OpMsgRequest& request,
- StringData dbName)
- : CommandInvocation(definition), _request(request), _dbName(dbName) {}
+ Invocation(const ClusterFindCmdBase* definition, const OpMsgRequest& request)
+ : CommandInvocation(definition),
+ _request(request),
+ _dbName(request.getValidatedTenantId(), request.getDatabase()) {}
private:
bool supportsWriteConcern() const override {
@@ -177,7 +177,7 @@ public:
auto aggCmdOnView =
uassertStatusOK(query_request_helper::asAggregationCommand(*findCommand));
auto viewAggregationCommand =
- OpMsgRequest::fromDBAndBody(_dbName, aggCmdOnView).body;
+ OpMsgRequest::fromDBAndBody(_dbName.db(), aggCmdOnView).body;
auto aggRequestOnView = aggregation_request_helper::parseFromBSON(
opCtx,
@@ -247,7 +247,7 @@ public:
auto aggCmdOnView = uassertStatusOK(
query_request_helper::asAggregationCommand(cq->getFindCommandRequest()));
auto viewAggregationCommand =
- OpMsgRequest::fromDBAndBody(_dbName, aggCmdOnView).body;
+ OpMsgRequest::fromDBAndBody(_dbName.db(), aggCmdOnView).body;
auto aggRequestOnView = aggregation_request_helper::parseFromBSON(
opCtx,
@@ -303,7 +303,7 @@ public:
}
const OpMsgRequest& _request;
- const StringData _dbName;
+ const DatabaseName _dbName;
};
};