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β amongoc_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: ifdescriptionisNULL, she returnsNULL. no drama, no crash, justNULLright back at you. π
π AUTHOR π
MongoDB, Inc β the main characters themselves π§
π COPYRIGHT π
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
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms