0

I imported some json files into MongoDB, the json files are about 1GB/file total 20GB, but the database size is about 40GB, almost 1:2 , I create the collection with

db.createCollection("test",{"capped":false,"noPadding":true})

I know there might be many preallocated space, but how to reduce the database size

Jason Z
  • 265
  • 1
  • 6
  • 12
  • 1
    I'm not sure if this should be marked as a duplicate. It is quite similar, but "Reducing MongoDB database file size" seems to be concerned with recovering space after content is removed. OP doesn't mention having removing content. – Jared Dykstra Nov 04 '15 at 15:15

1 Answers1

-1

"Mongo" is called mongo because it's short for "humongous". It's not concerned with disk usage and allocates disk space exponentially, so it's common for the allocation to be 2x the data size.

There's not much you can do, other than moving to a different database; however, you can try reducing the length of your column names.

Jared Dykstra
  • 3,596
  • 1
  • 13
  • 25