鉴于它通过Mongo shell工作,通过pymongo传递相同的参数:
db.create_collection('test', storageEngine={'wiredTiger':{'configString':'block_compressor=zlib'}})
从官方文档我们看到
create_collection(name,codec_options = None,read_preference = None,write_concern = None,read_concern = None,**kwargs)
...
**kwargs(可选):其他关键字参数将作为create collection命令的选项传递