MONGOC_CLIENT...UTO_ENCRYPTION(3)
π¦ mongoc_client_pool_enable_auto_encryption β libmongoc, bestie π
okay so this is a page from libmongoc and it's about turning on automatic client-side encryption for a whole client pool. Very main-character function. Let's get into it β¨
β¨ SYNOPSIS β¨
bool
mongoc_client_pool_enable_auto_encryption (mongoc_client_pool_t *pool,
mongoc_auto_encryption_opts_t* opts,
bson_error_t* error);
π DESCRIPTION π
So literally what this does is enable automatic client side encryption on a mongoc_client_pool_t. Slay. π
But heads up: this requires libmongoc to be built with support for In-Use Encryption. Check out the In-Use Encryption docs for the instructions on how to enable In-Use Encryption in libmongoc β no cap, you can't skip that step. π«Ά
Automatic encryption is an enterprise-only feature, and it only applies to operations on a collection. It is not supported for operations on a database or view, and operations that aren't bypassed will result in error. π So if you wanna bypass automatic encryption for all operations, do it with mongoc_auto_encryption_opts_set_bypass_auto_encryption() in opts.
Also, automatic encryption requires the authenticated user to have the listCollections privilege action. iykyk π
And ngl, enabling automatic encryption reduces the maximum message size and may have a negative performance impact. Worth knowing before you turn it on, fr fr. π¦
π PARAMETERS π
clientβ amongoc_client_t. (yes bestie, that's what it says π )optsβ a requiredmongoc_auto_encryption_opts_t. Not optional. Do not forget it. πerrorβ abson_error_twhich is set on error.
π RETURNS π
Returns true if successful. Returns false and sets error otherwise. Periodt. β
πΈ SEE ALSO πΈ
mongoc_auto_encryption_opts_tmongoc_client_enable_auto_encryption()- In-Use Encryption for libmongoc
- The MongoDB Manual for Client-Side Field Level Encryption
- The MongoDB Manual for Queryable Encryption
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
cutest little sign-off ever: this was libmongoc 2.5.6, dated Oct 09, 2026, brought to you by MongoDB, Inc. stay encrypted, stay iconic, mwah ππ₯
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms