MONGOC_APM_CO...CTION_ID_INT64(3)

✨ MONGOC_APM_CO...CTION_ID_INT64 ✨

ok so this one is a libmongoc page, bestie β€” yes, the libmongoc, the C driver for MongoDB, we love her πŸ’… β€” and it's all about a tiny little getter function that hands you a server connection ID as an int64_t. short page, iconic energy, let's go πŸŽ€


✨ SYNOPSIS ✨

int64_t
mongoc_apm_command_started_get_server_connection_id_int64 (
  const mongoc_apm_command_started_t *event);

🌸 DESCRIPTION 🌸

so this returns the server connection ID for the command 🫢 like, the ID of the connection, not the ID of the server β€” those are two whole different things, do not confuse them, i'm literally begging πŸ™ˆ

the server connection ID is distinct from the server ID (which, fyi, is what mongoc_apm_command_started_get_server_id() gives you, different function, different vibe). and where does this connection ID come from? it's returned by the hello or legacy hello response as "connectionId" from the server on 4.2+ ✨ so if you're on an older server, she might not be there, iykyk πŸ’€

πŸ¦‹ PARAMETERS πŸ¦‹

  • event β€” a mongoc_apm_command_started_t. that's it, that's the whole parameter, main character behavior honestly πŸ‘‘

⭐ RETURNS ⭐

the server connection ID as a positive integer πŸ₯³ or -1 if it is not available 😭 (yes, negative one means "no connection ID for you", don't @ me, that's just how it is)

SEE ALSO: Introduction to Application Performance Monitoring β€” go read it, bestie, it's the whole context for this APM moment 🧚

πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc β€” periodt πŸ’…

2009-present, MongoDB, Inc. β€” protect the copyright, always 🌈


aaand that's the page!! mwah πŸ’– this was libmongoc version 2.5.6, dated Oct 09, 2026 β€” screenshot it, cite it, love it, bye bestie πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from