MONGOC_CLIENT_APPEND_METADATA(3)
π MONGOC_CLIENT_APPEND_METADATA π
okay bestie so this is a page out of the libmongoc manual, and honestly it's a little gem. it's called mongoc_client_append_metadata(3) and it's literally about making your driver introduce itself properly when it says hi to the server π«Ά
β¨ SYNOPSIS β¨
bool
mongoc_client_append_metadata (mongoc_client_t *client,
const char *name,
const char *version,
const char *platform)
π DESCRIPTION π
so what this does is append metadata to the handshake command β the one that gets sent as part of the initial connection handshake (that's the "hello" command, iykyk). it's giving "let me tell you who i am before we get into anything serious" π
if you want the full lore, go look at mongoc_handshake_data_append() β that's where the details live.
one thing to note, and it's kind of the whole vibe: the updated handshake command applies only to the given client object, and only for connections that get established after the append took place. so no, it does not retroactively fix up connections you already had open. her main character era starts now, not earlier β¨
π PARAMETERS π
clientβ Amongoc_client_t. literally the client you're doing this to πnameβ the name of the wrapping driver. Must not be null or an empty string β like, do not play with her, she needs an actual name πversionβ the optional version of the wrapping driver. optional optional optional, no pressure bestieplatformβ optional info about the current platform, for example configure options or compile flags. the "where do you even go to school" of handshake fields πΈ
β οΈ okay this is the important one: no string argument may contain the substring" / "β that's the delimiter used between metadata field values. so if your cute little platform string has/in it, that's a vibe check fail. do not pass go π
π₯ RETURNS π₯
this function will log an error and return false when either of these happens:
clientis from amongoc_client_pool_tβ in that case you needmongoc_client_pool_append_metadata()instead. wrong tool for the job, bestie, but it's an honest mistake π«Ά- the resulting handshake document would exceed the size limit. she's too much. even for us.
otherwise it returns true if the given fields are set successfully. slay π
π SEE ALSO
mongoc_client_pool_append_metadata()mongoc_handshake_data_append()
π AUTHOR π
MongoDB, Inc β iconic, no notes.
π¦ COPYRIGHT π¦
2009-present, MongoDB, Inc. β that's the whole copyright line fr fr, respect the lineage π
and that's the page!! written by the fine folks at MongoDB, Inc, from libmongoc 2.5.6, dated Oct 09, 2026 β go forth and introduce yourself to your servers properly πβ¨π
π¦ 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