Aroxo Senraj
2018-06-13 10:57:09 UTC
1. First I have checked MongoDB Size 36GB
2. I have removed few tables data
3. Again I have checked MongoDB Size (36GB) not reduced. After I have
searched google and solution.
I have tried few below methods and take more time, slow my application
(hang)
Method 1: db.repairDatabase
Method 2:
db.getMongo().getDBNames().forEach(function(dbName) {
if ("local" != dbName && "admin" != dbName && "system" != dbName) {
var subject = db.getSiblingDB(dbName);
subject.getCollectionNames().forEach(function (collectionName) {
print('Compacting: ' +dbName + " - " + collectionName);
subject.runCommand({ compact: collectionName });
});
}
});
So, I need better solution. If any one know about this kindly let me know.
2. I have removed few tables data
3. Again I have checked MongoDB Size (36GB) not reduced. After I have
searched google and solution.
I have tried few below methods and take more time, slow my application
(hang)
Method 1: db.repairDatabase
Method 2:
db.getMongo().getDBNames().forEach(function(dbName) {
if ("local" != dbName && "admin" != dbName && "system" != dbName) {
var subject = db.getSiblingDB(dbName);
subject.getCollectionNames().forEach(function (collectionName) {
print('Compacting: ' +dbName + " - " + collectionName);
subject.runCommand({ compact: collectionName });
});
}
});
So, I need better solution. If any one know about this kindly let me know.
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/7bc474da-454b-44a1-b70b-d4a906d061ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/7bc474da-454b-44a1-b70b-d4a906d061ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.