diff options
author | Sophia Tan <sophia_tll@hotmail.com> | 2022-08-03 05:40:35 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-03 06:32:21 +0000 |
commit | f738dc2d800011ddbdec59ac4c3ea134d0982a75 (patch) | |
tree | 62fa06b8c63c9fbe6ed9944f42cd2e387379718c /src/mongo/s/commands/cluster_count_cmd.cpp | |
parent | a64e8b26f542b3e3b3fd3b97fb6f46e8a378b74c (diff) | |
download | mongo-f738dc2d800011ddbdec59ac4c3ea134d0982a75.tar.gz |
SERVER-68398 Change BasicCommandWithReplyBuilderInterface::parseNs to take in DatabaseName and BSONObj and return NamespaceString object
Diffstat (limited to 'src/mongo/s/commands/cluster_count_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_count_cmd.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/s/commands/cluster_count_cmd.cpp b/src/mongo/s/commands/cluster_count_cmd.cpp index b70329dc312..c1603f8813e 100644 --- a/src/mongo/s/commands/cluster_count_cmd.cpp +++ b/src/mongo/s/commands/cluster_count_cmd.cpp @@ -93,7 +93,7 @@ public: std::string& errmsg, BSONObjBuilder& result) override { CommandHelpers::handleMarkKillOnClientDisconnect(opCtx); - const NamespaceString nss(parseNs(dbname, cmdObj)); + const NamespaceString nss(parseNs({boost::none, dbname}, cmdObj)); uassert(ErrorCodes::InvalidNamespace, str::stream() << "Invalid namespace specified '" << nss.ns() << "'", nss.isValid()); @@ -195,7 +195,6 @@ public: const OpMsgRequest& request, ExplainOptions::Verbosity verbosity, rpc::ReplyBuilderInterface* result) const override { - std::string dbname = request.getDatabase().toString(); const BSONObj& cmdObj = request.body; CountCommandRequest countRequest(NamespaceStringOrUUID(NamespaceString{})); @@ -205,7 +204,7 @@ public: return exceptionToStatus(); } - const NamespaceString nss(parseNs(dbname, cmdObj)); + const NamespaceString nss(parseNs(request.getDatabase(), cmdObj)); uassert(ErrorCodes::InvalidNamespace, str::stream() << "Invalid namespace specified '" << nss.ns() << "'", nss.isValid()); |