Jafar
Jafar

Reputation: 130

DB consuming large space

i am newbie to mongoDB ,as i start working with test application (ASP.Net) found that the db consuming large disk space.I was wondering that collections have only small piece of data like a word.So does anybody can shed some light on this ?

Please correct me if am wrong.Thanks in advance

Upvotes: 0

Views: 114

Answers (1)

Oleg V. Volkov
Oleg V. Volkov

Reputation: 22441

Mongo doesn't shrink previously allocated structures because that would slow database down. When you need it, run the repair procedure to rebuild DB and reclaim unused space. On live project you should schedule it to off-peak hours.

From the command line:

mongod --repair

From the shell (you have to do for all dbs including local if you go this route):

db.repairDatabase();

Upvotes: 3

Related Questions