mongodb - Dropping Mongo collection not clearing disk space -


i have collection 750,000 documents, it's taking around 7gb on disk.

i've dropped collection, files (test.0...test.11) still on disk.

  • if delete them, loose collections, not 1 dropped
  • shouldn't mongo deleting them?

just noticed database stats have error.

{     "ok" : 0,     "errmsg" : "collection [test.loadtest-2016-02-06 15:05:34z] not found." } 

you have dropped collection, not database containing it. dropping collection not compact data files, nor deleting document. if want compact database, either drop entirely , reimport it, or compact using repairdatabase (see docs). beware though, cannot compact database online think if have 1 node.

if have replica set, adding new nodes , removing old ones safest way of compacting database online. time time , it's easy.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -