MONGOC_URI_SET_OPTION_AS_INT64(3)
π MONGOC_URI_SET_OPTION_AS_INT64 π
ok so bestie, this one lives in the libmongoc family β it's the little function that lets you go "hey, change this URI option to a big number" after the URI's already been parsed. no cap, it's honestly so useful.
β¨ SYNOPSIS β¨
bool
mongoc_uri_set_option_as_int64 (const mongoc_uri_t *uri,
const char *option,
int64_t value);
look at her π«Ά three little arguments, one very tidy bool coming back. iconic behavior.
π PARAMETERS π
uriβ amongoc_uri_t. like, the URI you're messing with. she's the main character here πoptionβ the name of an option, case insensitive (so don't stress about caps, she literally does not care).valueβ the new value, as anint64_t.
πΈ DESCRIPTION πΈ
So here's the vibe: this function sets an individual URI option, after the URI has already been parsed from a string. like, the parsing party is over, and now you're doing some post-party editing β¨.
Only known options of type int32 or int64 can be set β that's the rule, bestie, no exceptions π.
Now for the messy part: if you've got a 32-bit integer option and you try to shove a 64-bit value in there that exceeds the range of an int32_t, the function returns false. Yep, she said no. π But values that do fit into an int32_t get set correctly, no drama. And in both cases β yep, both β a warning will be emitted. so keep an eye on your stderr, ok?
As for where it goes: if the option is already set, it gets updated in-place (slay, efficient). Otherwise it gets appended to the URI's bson_t of options. either way she ends up where she belongs π.
β RETURNS β
Returns true if successfully set β meaning the named option is a known option of type int64. that's the win condition, periodt. π
SEE ALSO:
mongoc_uri_option_is_int64()mongoc_uri_set_option_as_int32()
like, those two are her besties, go say hi π¦
π§ AUTHOR π§
MongoDB, Inc β the whole crew π
π COPYRIGHT π
2009-present, MongoDB, Inc.
ok and finally, the little sign-off at the bottom of the page: this is libmongoc version 2.5.6, dated Oct 09, 2026. write it in your notes, bestie, iykyk πβ¨π
π¦ 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