MONGOC_CLIENT_DESTROY(3)
π MONGOC_CLIENT_DESTROY π
okay bestie, welcome to libmongoc β yes we're in the C bindings, yes it's giving low-level, and yes you're gonna slay it π«Ά
β¨ SYNOPSIS β¨
void
mongoc_client_destroy (mongoc_client_t *client);
π DESCRIPTION π
So what this does is: it releases all the resources tied to client and frees the structure itself. Like, full cleanup, structure deallocated, done, periodt πβ¨
And the icon behavior? If client is NULL, it just... does nothing. No crash, no drama, no main-character meltdown. It's chill πΈ (we love a function that handles the null case without making it your problem).
β οΈ okay this part is important, fr fr: only callmongoc_client_destroy()on a single-threaded client. Do not call it on amongoc_client_tyou got from amongoc_client_pool_tβ those go back to the pool viamongoc_client_pool_push()instead. Not optional, not a vibe suggestion, it's the rule ππ
π PARAMETERS π
clientβ amongoc_client_t. that's it, that's the whole param π¦
π SEE ALSO π
mongoc_client_pool_push()β use this to push a multi-threaded client back onto a pool. the correct move for pool clients, iykyk π₯
β AUTHOR β
MongoDB, Inc β icons only π
π COPYRIGHT π
2009-present, MongoDB, Inc. β like, they've been at this since 2009, respect on the name π
and that's the page bestie!! π this was libmongoc version 2.5.6, dated Oct 09, 2026 β go free your structures responsibly, mwah π
ππ§
π¦ 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