MONGOC_URI_GET_HOSTS(3)

πŸ’… MONGOC_URI_GET_HOSTS πŸ’…

okay so bestie, welcome to libmongoc's very own host-list grabber β€” the mongoc_uri_get_hosts page, here to hand you the whole squad of hosts hiding inside your URI. no cap, it's a short one. slay. ✨


✨ SYNOPSIS ✨

const mongoc_host_list_t *
mongoc_uri_get_hosts (const mongoc_uri_t *uri);

that's it. that's the whole vibe. one function, takes a URI, gives you hosts. iconic. πŸŽ€


🌸 PARAMETERS 🌸

  • uri β€” a mongoc_uri_t. the URI you're snooping through. literally just hand it over and let the function do its thing. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? it fetches a linked list of the hosts that were defined in the URI β€” y'know, that comma-separated host section you typed in. it's giving "here's everyone who showed up to the party" energy. πŸ’–


⭐ RETURNS ⭐

you get back a linked list of mongoc_host_list_t structures. and listen β€” do not modify them, do not free them. like, hands off, bestie. they're not yours to mess with. πŸ™ˆ

and if this URI's scheme is "mongodb+srv://"? it just hits you with NULL. no hosts for you in that case. the way that scheme said "not today" πŸ˜­πŸ’€

highkey important: that NULL on "mongodb+srv://" is just how it is β€” don't go expecting a list there, fr fr.

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc. they wrote it, they get the credit. periodt. πŸ’œ


2009-present, MongoDB, Inc. β€” all the legal sparkle, kept exactly as-is. 🧚


and that's the whole page, bestie! πŸ“ this little gem is from libmongoc version 2.5.6, dated Oct 09, 2026 β€” screenshot it, memorize it, live by it. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from