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 withmongoc_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β amongoc_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 π
π COPYRIGHT π
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
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms