MONGOC_CLIENT...E_OPTS_SET_MAX(3)

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

okay bestie, so this one lives in the libmongoc manual (yes, that's the manual name, don't @ me) β€” and it's the glow-up for your range-encryption max value. let's get into it ✨


πŸŽ€ SYNOPSIS πŸŽ€

void
mongoc_client_encryption_encrypt_range_opts_set_max (
     mongoc_client_encryption_encrypt_range_opts_t *range_opts,
     const bson_value_t *max);

New in version 1.24.0. πŸŽ‰

So what does it do? It sets the maximum value of the range for explicit encryption. that's the whole vibe, no cap.

⚠️ Important vibe check: this only applies when the algorithm set by mongoc_client_encryption_encrypt_opts_set_algorithm() is "Range". If the algorithm is not "Range" and you set a maximum anyway? that's an error, babe. it's giving "wrong room, wrong party" πŸ’€

Also, the maximum must match the value set in the encryptedFields of the destination collection. Setting a different value is, again, an error. like, the encryption gods already decided β€” don't fight them 🫢

And for double and decimal128 fields: max/max/precision must all be set, or all be unset. all in or all out, no half-sending. periodt πŸ’…


🌸 PARAMETERS 🌸

  • range_opts β€” a mongoc_client_encryption_encrypt_range_opts_t (your opts baddie, the main character here πŸ‘‘)
  • max β€” the maximum bson value of the range ⭐

πŸ’– SEE ALSO πŸ’–

  • mongoc_client_encryption_encrypt_range_opts_set_precision()
  • mongoc_client_encryption_encrypt_range_opts_set_min()
  • mongoc_client_encryption_encrypt_range_opts_t

iykyk, go read those next πŸ¦‹


🧚 AUTHOR 🧚

MongoDB, Inc

2009-present, MongoDB, Inc.


and that's the whole page, bestie β€” slay πŸ’…βœ¨ this was libmongoc version 2.5.6, dated Oct 09, 2026, signing off πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from