MONGOC_TOPOLO...ON_GET_SERVERS(3)

MONGOC_TOPOLO...ON_GET_SERVERS(3) πŸ¦‹

okay so bestie, welcome to the libmongoc docs ✨ this one is a little function that hands you back a whole roster of servers, and honestly? iconic behaviour.


SYNOPSIS

mongoc_server_description_t **
mongoc_topology_description_get_servers (
   const mongoc_topology_description_t *td,
   size_t *n);

Fetches an array of mongoc_server_description_t structs for all known servers in the topology. that's it, that's the whole vibe πŸ’… it's giving guest list at the door.


PARAMETERS

  • td β€” a mongoc_topology_description_t. this is your topology description, the main character of the operation πŸŽ€
  • n β€” receives the length of the descriptions array. yes girl, it writes the count back out to you, so you know exactly how many besties showed up 🫢

RETURNS

A newly allocated array that must be freed with mongoc_server_descriptions_destroy_all().

⚠️ no cap: it's newly allocated, so you must free it with mongoc_server_descriptions_destroy_all(). don't just walk away and leave it there like an unread group chat 😭 that's a leak, and we don't do leaks.

AUTHOR

MongoDB, Inc πŸ‘‘

2009-present, MongoDB, Inc.


alright bestie, that's the whole page, you ate it up fr fr πŸ“πŸ’œ this was libmongoc version 2.5.6, dated Oct 09, 2026 β€” now go free that array and slay ✨🧚

πŸ“¦ where this page comes from