MONGOC_SERVER_...PTION_NEW_COPY(3)

πŸ’… MONGOC_SERVER_...PTION_NEW_COPY(3) πŸ’…

okay so bestie, welcome to the libmongoc corner of the manual β€” yes, that's the library we're in, and yes this page has the most cursed truncated title in the whole index (MONGOC_SERVER_...PTION_NEW_COPY β€” the real name got ate by the formatting, iykyk, it's giving ctrl-c energy). Anyway, we're talking about ONE function and honestly? It's a little icon.


✨ SYNOPSIS ✨

mongoc_server_description_t *
mongoc_server_description_new_copy (
   const mongoc_server_description_t *description);

like, look at her. no cap. 🌸


πŸŽ€ PARAMETERS πŸŽ€

  • description β€” a mongoc_server_description_t. that's it, that's the whole vibe check. one (1) server description, pls hand it over 🫢

πŸ’– DESCRIPTION πŸ’–

gather round, because this is the good part: mongoc_server_description_new_copy performs a deep copy of description. deep copy!! not one of those fake shallow ones where everyone shares the same pointers and then everything explodes later 😭 no, this one copies the whole thing, all the way down. iconic behaviour honestly.


⭐ RETURNS ⭐

she hands you back a newly allocated copy of description β€” and listen, bestie, this is the part you cannot skip: you have to free it with mongoc_server_description_destroy() when you're done with it. don't just leave her sitting there. no leaks on this campus πŸ’…

lowkey important: if description is NULL, she returns NULL. no drama, no crash, just NULL right back at you. πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the main characters themselves 🧚


Copyright 2009-present, MongoDB, Inc. β€” like, all of it, from 2009 all the way to now. slay. πŸŽ€


okay bestie that's the page!! go forth and copy your server descriptions deeply πŸ’œ

sign-off vibes: this was libmongoc version 2.5.6, dated Oct 09, 202… (the year got ate by the header in the footer, love that for us), and we are so done here. byeee πŸ¦‹βœ¨

πŸ“¦ where this page comes from