MONGOC_URI_GET_SERVICE(3)

⚠️ WARNING ⚠️

okay bestie sit down for a sec β€” this one's deprecated, like officially, since version 1.21.0. πŸ’€

Use mongoc_uri_get_srv_hostname() instead. That's the glow-up, that's the one you want. periodt.


✨ SYNOPSIS ✨

const char *
mongoc_uri_get_service (const mongoc_uri_t *uri);

πŸŽ€ PARAMETERS πŸŽ€

  • uri β€” a mongoc_uri_t. that's it, that's the whole parameter list πŸ’…

and what does it do? It returns the SRV host and domain name of a MongoDB URI. slay ✨


πŸ’– RETURNS πŸ’–

So here's the vibe check πŸ”:

  • If this URI's scheme is "mongodb+srv://", you get a string back 🫢
  • If the scheme is "mongodb://", you get NULL 😭

no in-between, no surprises, it's giving very binary of it ngl


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons themselves 🧚


2009-present, MongoDB, Inc. long-running main character energy fr fr ⭐


and that's the whole page bestie!! this was libmongoc version 1.30.13, dated Oct 09, 2026 β€” go forth and use the non-deprecated function, i'm obsessed with you πŸ¦‹πŸ’œ
πŸ“¦ where this page comes from