Discussion:
[mongodb-dev] How to reduce MongoDB size after remove data
Aroxo Senraj
2018-06-13 10:57:09 UTC
Permalink
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.
--
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.
'Wan Bachtiar' via mongodb-dev
2018-07-06 05:59:06 UTC
Permalink
Hi Aroxo,

Questions related to the use of MongoDB (i.e. your question) are better
sent to mongodb-user group
<https://groups.google.com/forum/#!forum/mongodb-user>. This group
(mongodb-dev) is for discussion for/by/about developers/development/code of
MongoDB.

Please post a new discussion on mongodb-user group
<https://groups.google.com/forum/#!forum/mongodb-user> with the following
information:

- MongoDB server version
- Storage engine
- How did you check the "MongoDB size" ? i.e. filesystem commands or
mongo shell commands

Regards,
Wan.
​
--
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/0285f4da-e4e3-4120-bd92-81e8a3853a19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...