summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/drop_indexes.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-02-27 05:32:55 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-27 11:04:08 +0000
commitc455e6cfc269a5ce2e6b9c2aa5bb9cc6d33f7a00 (patch)
treee91b45de65ee09357db9d58cdc250a83edb476d7 /src/mongo/db/commands/drop_indexes.cpp
parentf676daac201f886a3994c545f9bb8636e7ed15a0 (diff)
downloadmongo-c455e6cfc269a5ce2e6b9c2aa5bb9cc6d33f7a00.tar.gz
SERVER-54643 clean up dropIndexes imports and namespace
Diffstat (limited to 'src/mongo/db/commands/drop_indexes.cpp')
-rw-r--r--src/mongo/db/commands/drop_indexes.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp
index 9a4ef95c51f..0683cea99d5 100644
--- a/src/mongo/db/commands/drop_indexes.cpp
+++ b/src/mongo/db/commands/drop_indexes.cpp
@@ -60,10 +60,7 @@
namespace mongo {
-using std::endl;
-using std::string;
-using std::stringstream;
-using std::vector;
+namespace {
MONGO_FAIL_POINT_DEFINE(reIndexCrashAfterDrop);
@@ -125,9 +122,9 @@ public:
CmdReIndex() : ErrmsgCommandDeprecated("reIndex") {}
bool errmsgRun(OperationContext* opCtx,
- const string& dbname,
+ const std::string& dbname,
const BSONObj& jsobj,
- string& errmsg,
+ std::string& errmsg,
BSONObjBuilder& result) {
const NamespaceString toReIndexNss =
@@ -162,9 +159,9 @@ public:
const auto defaultIndexVersion = IndexDescriptor::getDefaultIndexVersion();
- vector<BSONObj> all;
+ std::vector<BSONObj> all;
{
- vector<string> indexNames;
+ std::vector<std::string> indexNames;
writeConflictRetry(opCtx, "listIndexes", toReIndexNss.ns(), [&] {
indexNames.clear();
DurableCatalog::get(opCtx)->getAllIndexes(
@@ -174,7 +171,7 @@ public:
all.reserve(indexNames.size());
for (size_t i = 0; i < indexNames.size(); i++) {
- const string& name = indexNames[i];
+ const std::string& name = indexNames[i];
BSONObj spec = writeConflictRetry(opCtx, "getIndexSpec", toReIndexNss.ns(), [&] {
return DurableCatalog::get(opCtx)->getIndexSpec(
opCtx, collection->getCatalogId(), name);
@@ -258,4 +255,6 @@ public:
return true;
}
} cmdReIndex;
+
+} // namespace
} // namespace mongo