Skip to content

Comment on MongoDB Gotchas and How To Avoid Them

Comments

Here is one to add to the list - if you delete records and/or entire collections, you won't reclaim the associated disk space automatically. Once the space is allocated, it remains allocated and will be reused when more data is added later. If you want to reclaim the "empty space", you need to run a repairDatabase() which will lock the entire database while it's busy.

ukd1OP

or compact, which you can run on a secondary...good call - missed this one! Will add shortly.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.