Scroll to navigation

MONGOC_CLIENT_POOL_ENABLE_AUTO_ENCRYPTION(3) libmongoc MONGOC_CLIENT_POOL_ENABLE_AUTO_ENCRYPTION(3)

SYNOPSIS

bool
mongoc_client_pool_enable_auto_encryption (mongoc_client_pool_t *pool,

mongoc_auto_encryption_opts_t* opts,
bson_error_t* error);


Enable automatic client side encryption on a mongoc_client_pool_t <>. Requires libmongoc to be built with support for In-Use Encryption. See In-Use Encryption <https://www.mongodb.com/docs/languages/c/c-driver/current/libmongoc/guides/in-use-encryption/> for instructions to enable In-Use Encryption in libmongoc.

Automatic encryption is an enterprise-only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error. To bypass automatic encryption for all operations, bypass automatic encryption with mongoc_auto_encryption_opts_set_bypass_auto_encryption() <> in opts.

Automatic encryption requires the authenticated user to have the listCollections privilege action <https://www.mongodb.com/docs/manual/reference/command/listCollections/#dbcmd.listCollections>.

Enabling automatic encryption reduces the maximum message size and may have a negative performance impact.

PARAMETERS


RETURNS

Returns true if successful. Returns false and sets error otherwise.

See also:

mongoc_auto_encryption_opts_t <>

mongoc_client_enable_auto_encryption() <>

In-Use Encryption <https://www.mongodb.com/docs/languages/c/c-driver/current/libmongoc/guides/in-use-encryption/> for libmongoc

The MongoDB Manual for Client-Side Field Level Encryption <https://www.mongodb.com/docs/manual/core/security-client-side-encryption/>

The MongoDB Manual for Queryable Encryption <https://www.mongodb.com/docs/manual/core/queryable-encryption/>



Author

MongoDB, Inc

Copyright

2009-present, MongoDB, Inc.

November 26, 2025 2.2.0