encryption_options
– Automatic Client-Side Field Level Encryption
class pymongo.encryption_options.AutoEncryptionOpts
(kms_providers, key_vault_namespace, key_vault_client=None, schema_map=None, bypass_auto_encryption=False, mongocryptd_uri=’mongodb://localhost:27020’, mongocryptd_bypass_spawn=False, mongocryptd_spawn_path=’mongocryptd’, mongocryptd_spawn_args=None)
Options to configure automatic client-side field level encryption.
Automatic client-side field level encryption requires MongoDB 4.2 enterprise or a MongoDB 4.2 Atlas cluster. Automatic encryption is not supported for operations on a database or view and will result in error.
Although automatic encryption requires MongoDB 4.2 enterprise or a MongoDB 4.2 Atlas cluster, automatic decryption is supported for all users. To configure automatic decryption without automatic encryption set bypass_auto_encryption=True
. Explicit encryption and explicit decryption is also supported for all users with the ClientEncryption class.
See for an example.
New in version 3.9.