MONGOC_CLIENT...TENTION_FACTOR(3)

πŸ’… SYNOPSIS πŸ’…

okay bestie, so this page is from libmongoc (the MongoDB C driver, iykyk) and it's all about one tiny little function that sets the contention factor for explicit encryption. say it with me: contention factor. slay.

void
mongoc_client_encryption_encrypt_opts_set_contention_factor (
    mongoc_client_encryption_encrypt_opts_t *opts, int64_t contention_factor);

✨ New in version 1.22.0. ✨ like, that's when it dropped.

So what does it do? It sets a contention factor for explicit encryption. Butβ€”and this is the important part, don't skip itβ€”it only applies when the algorithm you set with mongoc_client_encryption_encrypt_opts_set_algorithm() is "Indexed" or "Range". Literally only those two.

🫢 heads up bestie: it is an error to set the contention factor when the algorithm is not "Indexed" or "Range". not a vibe. the driver will not be happy with you.

And if you never supply a contention factor at all? No stress β€” it defaults to a value of 0. πŸŽ€


🌈 PARAMETERS 🌈

  • opts β€” a mongoc_client_encryption_encrypt_opts_t. it's the options struct, the main character of this whole operation ✨
  • contention_factor β€” a non-negative contention factor. non-negative!! keep it that way πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” yes, that MongoDB. the icons themselves. πŸ’œ


2009-present, MongoDB, Inc. β€” periodt, that's the copyright line, keeping it exactly as it is fr fr.


and that's the whole page bestie, you ate that πŸ¦‹

signing off from libmongoc version 2.5.6, dated Oct 09, 2026 β€” go forth and encrypt responsibly πŸ’–

πŸ“¦ where this page comes from