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 β€” a mongoc_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 an int64_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 πŸ‘‘

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