MONGOC_CLIENT..._SET_ALGORITHM(3)

πŸ’… MONGOC_CLIENT..._SET_ALGORITHM(3) ✨

okay bestie, gather round 🫢 this is a libmongoc manual page, and it's literally about setting the encryption algorithm on your explicit-encryption opts struct. yes, the function name is mongoc_client_encryption_encrypt_opts_set_algorithm and yes, the header up top is just the truncated version of it β€” the terminal did its little truncation thing, iykyk 😭


✨ SYNOPSIS ✨

here's the whole cast of algorithm string constants, copied exactly because we do not mess with the literals, periodt:

#define MONGOC_AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
#define MONGOC_AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
#define MONGOC_ENCRYPT_ALGORITHM_INDEXED "Indexed"
#define MONGOC_ENCRYPT_ALGORITHM_UNINDEXED "Unindexed"
#define MONGOC_ENCRYPT_ALGORITHM_RANGE "Range"
#define MONGOC_ENCRYPT_ALGORITHM_RANGEPREVIEW "RangePreview" // Deprecated.
#define MONGOC_ENCRYPT_ALGORITHM_TEXTPREVIEW "TextPreview" // Deprecated.
#define MONGOC_ENCRYPT_ALGORITHM_STRING "String"

and the function itself:

void
mongoc_client_encryption_encrypt_opts_set_algorithm (
   mongoc_client_encryption_encrypt_opts_t *opts, const char *algorithm);

what does it do? sets the algorithm for explicit encryption. that's it. that's the whole vibe. πŸŽ€


🌸 PARAMETERS 🌸

  • opts β€” a mongoc_client_encryption_encrypt_opts_t. your options struct. the main character, honestly πŸ‘‘
  • algorithm β€” a char * that identifies the algorithm. one of those #define strings up there, bestie πŸ’…

πŸ¦‹ SEE ALSO: πŸ¦‹

  • see CSFLE explicit encryption and Queryable Encryption for algorithm usage. that's where the algorithm actually gets used, so go look if you're curious πŸ‘€

🌈 AUTHOR 🌈

MongoDB, Inc β€” them. the whole entire company. 🫢


2009-present, MongoDB, Inc.


ngl the deprecated ones are actually marked deprecated in the source β€” MONGOC_ENCRYPT_ALGORITHM_RANGEPREVIEW and MONGOC_ENCRYPT_ALGORITHM_TEXTPREVIEW both carry a // Deprecated. comment. so like, they're still there, but the source is telling you something πŸ™ˆ

and that's the page! βœ¨πŸ¦‹ sign-off time: this was libmongoc version 2.5.6, dated Oct 09, 2026 β€” write it down in your notes app, bestie, future you will thank you πŸ’–πŸŽ€

πŸ“¦ where this page comes from