How to add wiredTiger in pymongo at collection level? How to add wiredTiger in pymongo at collection level? mongodb mongodb

How to add wiredTiger in pymongo at collection level?


Given it works via the Mongo shell, pass the same parameters via pymongo:

db.create_collection('test',                     storageEngine={'wiredTiger':{'configString':'block_compressor=zlib'}})

from the official docs we see that

create_collection(name, codec_options=None, read_preference=None,write_concern=None, read_concern=None, **kwargs)

...

**kwargs (optional): additional keyword arguments will be passed as options for the create collection command