MONGOC_CLIENT...URI_WITH_ERROR(3)

πŸ’… MONGOC_CLIENT...URI_WITH_ERROR(3) πŸ’…

okay so bestie, welcome to the libmongoc manual β€” this one's all about mongoc_client_new_from_uri_with_error, and honestly? it's giving "small function, big main character energy." ✨


🌸 SYNOPSIS 🌸

mongoc_client_t *
mongoc_client_new_from_uri_with_error (const mongoc_uri_t *uri,
                                       bson_error_t *error);

lowkey the whole vibe is: it creates a brand new mongoc_client_t using the mongoc_uri_t you hand it. that's it. that's the function. πŸŽ€


πŸ¦‹ PARAMETERS πŸ¦‹

  • uri β€” a mongoc_uri_t. yes queen, that's the one you're building the client from. 🫢
  • error β€” an optional spot to stash a bson_error_t, or just NULL if you're feeling unbothered. πŸ™ˆ

⭐ RETURNS ⭐

you get back a newly allocated mongoc_client_t β€” and bestie, listen, you gotta free it with mongoc_client_destroy() when you're done with it. don't be that person who leaks memory, it's not the look. πŸ’€

on error? NULL comes back, and error gets populated with the error description. so like, check your error, iykyk. 😭

no cap β€” a returned client means you own it now, and freeing it is your responsibility. mongoc_client_destroy(), periodt. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons themselves. 🌈


2009-present, MongoDB, Inc. β€” fr fr, all rights reserved energy. πŸŽ€


and that's the whole page, bestie! libmongoc 2.5.6, dated Oct 09, 2026 β€” catch you on the next manpage, mwah! πŸ§šπŸ’œπŸ“

πŸ“¦ where this page comes from