MONGOC_URI_GET_DATABASE(3)
π MONGOC_URI_GET_DATABASE π
okay bestie, welcome to the libmongoc manual, section 3 β this is the page for MONGOC_URI_GET_DATABASE, and it's a short one but she's iconic. let's get into it π
β¨ SYNOPSIS β¨
const char *
mongoc_uri_get_database (const mongoc_uri_t *uri);
that's the whole signature, no cap. one function, one uri, one const char * coming back at you π¦
πΈ PARAMETERS πΈ
uriβ amongoc_uri_t. that's it. that's the parameter. she's a URI struct and she's the main character π
π DESCRIPTION π
so this one fetches the database portion of a URI, if one was provided in the first place π
and where exactly does that live? it's literally the portion after the / but before the ?. that's the vibe check. slash on the left, question mark on the right, database in the middle. periodt π
side note bestie: "if provided" is doing real work in that sentence. no database in the URI, no database coming back β we'll get to that in a sec π
π¦ RETURNS π¦
a string π β and important housekeeping: you should not modify it or free it. it's not yours, don't touch her. and if there's nothing to give you, she returns NULL π
so to recap the return value possibilities:
- a string (do not modify, do not free β fr fr, hands off) π
NULLπ
π AUTHOR π
MongoDB, Inc β yeah, that MongoDB π
β COPYRIGHT β
2009-present, MongoDB, Inc. β the whole run, babes π«Ά
and that's the page!! short and sweet, just like she should be π
okay so real talk, the tiny little sign-off at the bottom of the original said libmongoc 2.5.6, dated Oct 09, 2026 β so if you're out here quoting this in a group chat, that's your version and date, mwah πβ¨π§
π¦ 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