All Products
Search
Document Center

How to free up storage space

Last Updated: Aug 04, 2020

Precautions

  • Using the db.collection.remove command will not free up storage space.
  • Using the db.dropDatabase and db.collection.drop commands will delete the corresponding database and collection files and immediately free up storage space.

Operational recommendations

If you use the db.collection.remove command to delete a large amount of data, it is recommended that you use the compact command to free up storage space. For more information, see Sort database fragments to improve disk usage.