MONGOC_CLIENT_...KEY_EXPIRATION(3)

πŸ’… MONGOC_CLIENT_...KEY_EXPIRATION(3) πŸ’…

okay so bestie, this one lives in libmongoc (yep, the C driver for MongoDB) β€” it's a little setter function that controls how long your data encryption keys chill in the cache before they expire. short page, but it's giving important, so let's go ✨


🌸 SYNOPSIS 🌸

void
mongoc_client_encryption_opts_set_key_expiration (
   mongoc_client_encryption_opts_t *opts, uint64_t cache_expiration_ms);

that's it, that's the whole signature 🫢 it returns void, so no sneaky error code to check β€” respect.


πŸŽ€ PARAMETERS πŸŽ€

  • opts β€” the mongoc_client_encryption_opts_t you're configuring. your little options bag, your main character. πŸ‘œ
  • cache_expiration_ms β€” the data encryption key cache expiration time, measured in milliseconds. defaults to 60,000 (yes, that's the default, no cap). and the iconic part: 0 means "never expire". zero equals forever, which is lowkey poetic ngl. πŸ’€βœ¨
heads up bestie: 0 literally means the keys never expire from the cache. if you're into keys hanging around indefinitely, that's your setting β€” just know what you're asking for πŸ‘€

πŸ¦‹ SEE ALSO πŸ¦‹

  • mongoc_client_encryption_new()
  • In-Use Encryption

like, go read those too, they're the vibes adjacent to this one πŸ”₯


πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc β€” the whole thing is theirs, we're just living in it πŸ‘‘


2009-present, MongoDB, Inc. β€” periodt, all rights reserved, don't be weird about it πŸŽ€


and that's the wrap bestie!! this little beauty is from libmongoc version 2.5.6, dated Oct 09, 2024 β€” go forth and set those expirations responsibly πŸ’–πŸ§šβœ¨

πŸ“¦ where this page comes from