MONGOC_CLIENT..._SET_PRECISION(3)
β¨ MONGOC_CLIENT..._SET_PRECISION β¨
okay so bestie, this one lives in libmongoc (that's the MongoDB C driver, mwah) and it's a function that sets the precision on your range encryption options. group chat version: it's the little knob you twist so your encrypted numbers know how many digits to care about π
π SYNOPSIS π
void
mongoc_client_encryption_encrypt_range_opts_set_precision (
mongoc_client_encryption_encrypt_range_opts_t *range_opts, int32_t precision);
New in version 1.24.0. like, she's a fresh addition, respect her π«Ά
so what does she actually do? she sets the precision for explicit encryption. that's it, that's the job π
only applies when the algorithm you set via mongoc_client_encryption_encrypt_opts_set_algorithm() is "Range". it is an error to set precision when the algorithm is not "Range". so don't do that, bestie, the library will genuinely be upset with you π
precision can only be set with double or decimal128 fields. it is an error to set precision if the type of the encryptedFields in the destination collection is not double or decimal128. type check first, slay after β¨
for double and decimal128 fields, min/max/precision must all be set, or all be unset. no mixing and matching, it's an all-or-nothing vibe, no cap πΈ
precision must match the value set in the encryptedFields of the destination collection. it is an error to set a different value. mismatched numbers = chaos = not the energy we're bringing today π
π¦ PARAMETERS π¦
range_optsβ amongoc_client_encryption_encrypt_range_opts_t. the little options struct you're decorating πprecisionβ a non-negative precision. negative? absolutely not, that's not the move π
π SEE ALSO π
mongoc_client_encryption_encrypt_range_opts_set_min()mongoc_client_encryption_encrypt_range_opts_set_max()mongoc_client_encryption_encrypt_range_opts_t
(go read those too, they're the min/max siblings and they're lowkey iconic π)
π AUTHOR π
MongoDB, Inc β yes, that MongoDB, the whole company, showing up as the author like main character energy π§
π COPYRIGHT π
2009-present, MongoDB, Inc.
ok that's the whole page bestie, go forth and set your precision correctly, iykyk π π₯
sign-off szn: this is from libmongoc, version 2.5.6, and it's dated Oct 09, 2026 β screenshot it, cite it, love it ππ
π¦ 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