MONGOC_CLIENT_NEW(3)

πŸ’… MONGOC_CLIENT_NEW(3) πŸ’…

okay so bestie, welcome to libmongoc β€” this is the page for mongoc_client_new, and honestly? it's giving starter-pack energy. it makes you a brand-new mongoc_client_t out of the URI string you hand it. iconic, low-effort, essential. πŸŽ€


✨ SYNOPSIS ✨

mongoc_client_t *
mongoc_client_new (const char *uri_string);

creates a new mongoc_client_t using the URI string you provided. that's it, that's the whole vibe. πŸ¦‹


🌸 PARAMETERS 🌸

  • uri_string β€” a string containing the MongoDB connection URI. yes, string, as in const char *, as in you gotta give it something. πŸ’–

🫢 RETURNS 🫢

a newly allocated mongoc_client_t β€” fresh out the box, main character energy, all yours. and because it's newly allocated, you must free it with mongoc_client_destroy() when you're no longer using it. like, actually. don't ghost your memory. 😭

on error, NULL is returned and an error or warning will be logged. so if you get NULL back, check your logs, bestie, the tea is in there. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

  • mongoc_client_new_from_uri()

iykyk β€” that's the cousin function, go say hi. 🌈


⭐ AUTHOR ⭐

MongoDB, Inc


2009-present, MongoDB, Inc.


fr fr, that's the whole page. go forth and mongoc_client_destroy() responsibly. 🧚

sign-off szn: this slay of a page is from version 2.5.6, dated Oct 09, 2026 β€” libmongoc's finest, no cap. πŸ“πŸ’…πŸ”₯

πŸ“¦ where this page comes from