MONGOC_CLIENT...ET_TRIM_FACTOR(3)

πŸ’… mongoc_client_encryption_encrypt_range_opts_set_trim_factor(3) ✨

okay so bestie, we're in the libmongoc manual rn and this page is all about one tiny little setter that tunes how your Range queries perform. it's giving "small function, big vibes" πŸŽ€


🌸 SYNOPSIS 🌸

void
mongoc_client_encryption_encrypt_range_opts_set_trim_factor (
     mongoc_client_encryption_encrypt_range_opts_t *range_opts, int32_t trim_factor);

✨ New in version 1.28.0. ✨ (yes she's a newer girlie, we stan growth πŸ’–)

So what does she do? She sets the trim factor for explicit encryption. Periodt.

🚨 but listen β€” this only applies when the algorithm you set with mongoc_client_encryption_encrypt_opts_set_algorithm() is "Range". If your algorithm is literally anything else and you try to set trim factor? it's an error. not a vibe. πŸ’€

The trim factor is lowkey your performance-tuning knob β€” you use it to tune performance, iykyk. When you omit it, a default value is used. she has a fallback, she's prepared 🫢

And here's the part you CANNOT skip, bestie:

⚠️ The trim factor must match the value set in the encryptedFields of the destination collection. Setting a different value? it is an error. no cap, they will not let you get away with it πŸ™ˆ

πŸ¦‹ PARAMETERS πŸ¦‹

  • range_opts β€” a mongoc_client_encryption_encrypt_range_opts_t. your range opts struct, your main character πŸŽ€
  • trim_factor β€” a non-negative trim factor. keep it zero or up, bestie, no negatives allowed ⭐

πŸ‘€ SEE ALSO:

  • mongoc_client_encryption_encrypt_range_opts_t

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons behind all of this πŸ’œ

2009-present, MongoDB, Inc.


okay that's the whole page fr fr πŸ“ go forth and trim responsibly, bestie β€” this has been libmongoc 2.5.6, dated Oct 09, 2026, and honestly? iconic behavior all around πŸ’…βœ¨πŸŒ·

πŸ“¦ where this page comes from