MONGOC_URI_SET_AUTH_SOURCE(3)
π MONGOC_URI_SET_AUTH_SOURCE(3) π
okay so bestie, this is a page from libmongoc β yes, the MONGOC_URI_SET_AUTH_SOURCE(3) one, you found it, slay β and it's literally just about setting one little URI option after the fact. tiny page, big "authSource" energy. let's go π
β¨ SYNOPSIS β¨
bool
mongoc_uri_set_auth_source (mongoc_uri_t *uri, const char *value);
that's the whole vibe. one function, two args, returns a bool. iconic honestly πΈ
π«Ά PARAMETERS π«Ά
uriβ amongoc_uri_t. like, the URI object you're messing with. that one. πvalueβ the new"authSource"value. the fresh one you want in there instead of whatever's there now.
π¦ DESCRIPTION π¦
so this function sets the "authSource" URI option β but here's the thing: it does it after the URI has already been parsed from a string. so you've got your URI, it's parsed, it's living its life, and now you want to swap the auth source. this is the girl for that job β¨
and the way it works is lowkey satisfying: if the option is already set, it gets updated in-place (no extra copy, no drama). if it's not set yet, it just gets appended to the URI's bson_t of options. either way you're covered π
π₯ RETURNS π₯
it returns false if the option cannot be set β for example, if value is not valid UTF-8. π so yeah, feed it real UTF-8 or it's gonna say no. otherwise you're good.
ngl, check that return value. it's giving "I tried my best" when it returns false, and you deserve to know. π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay that's the whole page, periodt. π this was libmongoc 2.5.6, dated Oct 09, 2026 β go forth and set those auth sources, bestie, you're gonna ate π¦β¨π
π¦ 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