diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2018-01-10 17:09:22 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-01-16 13:52:44 -0500 |
commit | a6e45f0e35724ae7958e31fc141c89afcefe4d33 (patch) | |
tree | 5ac0bf28fc1b977078845cbff966ff3427cfaa92 /src/mongo/db/commands/list_indexes.cpp | |
parent | 1378f8ec42068913c5bdc5927bbe86d5aed08814 (diff) | |
download | mongo-a6e45f0e35724ae7958e31fc141c89afcefe4d33.tar.gz |
SERVER-32646 CommandHelpers
Diffstat (limited to 'src/mongo/db/commands/list_indexes.cpp')
-rw-r--r-- | src/mongo/db/commands/list_indexes.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index d94c798db00..10e4be8af33 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -104,7 +104,8 @@ public: // Check for the listIndexes ActionType on the database, or find on system.indexes for pre // 3.0 systems. - const NamespaceString ns(parseNsOrUUID(client->getOperationContext(), dbname, cmdObj)); + const NamespaceString ns( + CommandHelpers::parseNsOrUUID(client->getOperationContext(), dbname, cmdObj)); if (authzSession->isAuthorizedForActionsOnResource(ResourcePattern::forExactNamespace(ns), ActionType::listIndexes) || authzSession->isAuthorizedForActionsOnResource( @@ -125,25 +126,25 @@ public: const BSONObj& cmdObj, BSONObjBuilder& result) { Lock::DBLock dbSLock(opCtx, dbname, MODE_IS); - const NamespaceString ns(parseNsOrUUID(opCtx, dbname, cmdObj)); + const NamespaceString ns(CommandHelpers::parseNsOrUUID(opCtx, dbname, cmdObj)); const long long defaultBatchSize = std::numeric_limits<long long>::max(); long long batchSize; Status parseCursorStatus = CursorRequest::parseCommandCursorOptions(cmdObj, defaultBatchSize, &batchSize); if (!parseCursorStatus.isOK()) { - return appendCommandStatus(result, parseCursorStatus); + return CommandHelpers::appendCommandStatus(result, parseCursorStatus); } AutoGetCollectionForReadCommand autoColl(opCtx, ns, std::move(dbSLock)); if (!autoColl.getDb()) { - return appendCommandStatus( + return CommandHelpers::appendCommandStatus( result, Status(ErrorCodes::NamespaceNotFound, "Database " + ns.db() + " doesn't exist")); } const Collection* collection = autoColl.getCollection(); if (!collection) { - return appendCommandStatus( + return CommandHelpers::appendCommandStatus( result, Status(ErrorCodes::NamespaceNotFound, "Collection " + ns.ns() + " doesn't exist")); } @@ -181,7 +182,7 @@ public: auto statusWithPlanExecutor = PlanExecutor::make( opCtx, std::move(ws), std::move(root), cursorNss, PlanExecutor::NO_YIELD); if (!statusWithPlanExecutor.isOK()) { - return appendCommandStatus(result, statusWithPlanExecutor.getStatus()); + return CommandHelpers::appendCommandStatus(result, statusWithPlanExecutor.getStatus()); } auto exec = std::move(statusWithPlanExecutor.getValue()); |