Skip to content

Instantly share code, notes, and snippets.

@karan9
Created June 29, 2021 04:54
Show Gist options
  • Save karan9/a4d76c1c04e8f9eba92337bcfabc2314 to your computer and use it in GitHub Desktop.
Save karan9/a4d76c1c04e8f9eba92337bcfabc2314 to your computer and use it in GitHub Desktop.
Create a collection with zstd compression
// Create a ZSTD Collection
db.createCollection("COLLNAME", {storageEngine: {wiredTiger: {configString: "block_compressor=zstd"}}})
// Check which block compressor is being used for a collection
var wt_options = db.zlogs.stats().wiredTiger.creationString.split(',')
// filter the options
wt_options.filter((wt_options) => wt_options.startsWith('block_compressor'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment