Reputation: 13357
This is the configuration of my MongoDB :
systemLog:
path: "C:\\log\\mg.log"
logAppend: true
destination: file
storage:
dbPath: "c:\\data"
directoryPerDB: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 1
How can I Instruct the MongoDB engine to compress one particular collection?
Upvotes: 0
Views: 210
Reputation: 140
Speaking about a particular collection I see two options for you.
You can use a settings of storage when you create collection:
db.createCollection("your_collection",
{ storageEngine: {
wiredTiger: {configString: "blockCompressor=zlib"}
}})
OR you can compress your data on the side of application and store as binary. Probably it's better first to measure how much you will win in both cases.
Upvotes: 1