storage: engine: wiredTiger wiredTiger: collectionConfig: blockCompressor: none
I am not sure how to enable for fs.files and disable compression for fs.chunks
compression for fs.files and NOT for fs.chunks.
Hi Christopher,
Are there any particular reasons why would you want to disable compression for fs.chunks ? This would make sense if your (binary) data is already compressed enough.
With WiredTiger, MongoDB supports compression for all collections and indexes. By default, collection data in WiredTiger uses snappy block compression. Compression settings are also configurable on a per-collection and per-index basis during collection and index creation.
Note that you can’t change the compression setting on an existing collection. However you can export the data, drop the collection, re-create with the new compression option, and re-import the data.
When you create a new GridFS database, the driver would create the default collection names of fs.files and fs.chunks. So you need to pre-empt the creation of fs.chunks collection on the database to disable compression. You can utilise db.createCollection() to create a new collection and specify to disable compression. For example:
db.createCollection(
"fs.chunks",
{ storageEngine:
{ wiredTiger:
{ configString: "block_compressor=none" }
}
}
);
To confirm whether the collection has been created without compression, you can run db.collection.stats().wiredTiger.creationString and check the block_compressor value.
Regards,
Wan.