MONGOC_CLIENT...D_KEY_ALT_NAME(3)

πŸ’… MONGOC_CLIENT...D_KEY_ALT_NAME(3) πŸ’…

okay bestie so this one lives in libmongoc (that's the C driver for MongoDB, iykyk) and it's literally the glow-up function for your encryption keys ✨


πŸŽ€ SYNOPSIS πŸŽ€

bool
mongoc_client_encryption_add_key_alt_name (
   mongoc_client_encryption_t *client_encryption,
   const bson_value_t *keyid,
   const char *keyaltname,
   bson_t *key_doc,
   bson_error_t *error);

so what this does is it adds keyaltname to the set of alternate names in the key document with UUID keyid. that's it, that's the whole vibe πŸ’–


🌸 PARAMETERS 🌸

  • client_encryption β€” a mongoc_client_encryption_t. your main character struct, the one running the whole show πŸ‘‘
  • keyid β€” a UUID (BSON binary subtype 0x04) key ID of the key you're adding the key alternate name to. yes, subtype 0x04, memorize it, it's iconic πŸ¦‹
  • keyaltname β€” the key alternate name to add. the new nickname, the pet name, the ~alias~ πŸŽ€
  • key_doc β€” Optional. an uninitialized bson_t set to the value of the key document before addition of the alternate name, or an empty document if the key does not exist. must be freed by bson_destroy(). like, do not forget the bson_destroy(), I'm begging 😭
  • error β€” Optional. a bson_error_t. where the tea gets spilled if things go wrong πŸ«–

⭐ RETURNS ⭐

Returns true if successful. Returns false and sets error otherwise. simple as that, no cap πŸ’…

SEE ALSO: mongoc_client_encryption_t β€” go read that one next bestie, it's the whole friend group 🫢

✨ AUTHOR ✨

MongoDB, Inc β€” shoutout to the devs, they ate and left no crumbs πŸ”₯

2009-present, MongoDB, Inc.


k bye go encrypt something slay πŸ’œ β€” this has been libmongoc version 2.5.6, dated Oct 09, 2026, mwah 🧚

πŸ“¦ where this page comes from