diff options
author | Benety Goh <benety@mongodb.com> | 2018-10-25 20:19:34 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-10-25 20:19:54 -0400 |
commit | 03bd5fdab0e54256be3f19d9f827e0944a04fa5b (patch) | |
tree | 44b23c3259cb63636067ae0032cd9474c5c0be03 /src/mongo/db/commands/compact.cpp | |
parent | fc4c06660da1e121c817add86a56bbee1ef05f16 (diff) | |
download | mongo-03bd5fdab0e54256be3f19d9f827e0944a04fa5b.tar.gz |
SERVER-37589 make Collection::compact() a free function
Diffstat (limited to 'src/mongo/db/commands/compact.cpp')
-rw-r--r-- | src/mongo/db/commands/compact.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index 93bb813c56e..3c0400a77ea 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -40,6 +40,7 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/background.h" #include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/collection_compact.h" #include "mongo/db/catalog/database.h" #include "mongo/db/commands.h" #include "mongo/db/concurrency/d_concurrency.h" @@ -164,12 +165,9 @@ public: log() << "compact " << nss.ns() << " begin, options: " << compactOptions; - StatusWith<CompactStats> status = collection->compact(opCtx, &compactOptions); + StatusWith<CompactStats> status = compactCollection(opCtx, collection, &compactOptions); uassertStatusOK(status.getStatus()); - if (status.getValue().corruptDocuments > 0) - result.append("invalidObjects", status.getValue().corruptDocuments); - log() << "compact " << nss.ns() << " end"; return true; |