MONGOC_APM_CO..._CONNECTION_ID(3)

πŸ’… MONGOC_APM_CO..._CONNECTION_ID(3) πŸ’…

okay bestie, so this is a page from the libmongoc manual, and it's literally about getting the server connection ID off a command-succeeded APM event. but first, the ✨vibe check✨:

⚠️ WARNING: Deprecated since version 1.24.0 β€” use mongoc_apm_command_succeeded_get_server_connection_id_int64() instead. no cap, this one's on its way out, so if you're writing new code, use the int64 one, mwah 🫢

✨ SYNOPSIS ✨

int32_t
mongoc_apm_command_succeeded_get_server_connection_id (
  const mongoc_apm_command_succeeded_t *event);

🌸 DESCRIPTION 🌸

So basically this function returns the server connection ID for the command. πŸ’–

And listen, the server connection ID is distinct from the server ID (that's mongoc_apm_command_succeeded_get_server_id(), different girl, different function, iykyk). This one is returned by the hello or legacy hello response as "connectionId" from the server on 4.2+. the way that the server just hands it over πŸ’…

πŸŽ€ PARAMETERS πŸŽ€

  • event β€” a mongoc_apm_command_succeeded_t. that's the one, bestie, that's what you pass in 🌸

⭐ RETURNS ⭐

The server connection ID as a positive integer, or -1 if it's not available. periodt. no connection ID? you get -1. that's the deal. 😭

SEE ALSO: Introduction to Application Performance Monitoring β€” go read it, it's giving essential context πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” yeah, the MongoDB girlies themselves wrote this one πŸ’œ

2009-present, MongoDB, Inc.


and that's the whole page, bestie!! ✨ this came out of libmongoc version 1.30.13, dated Oct 09, 2026, and you've officially read the entire thing. slay, ate, no crumbs left. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from