MONGOC_SESSION...ANSACTION_OPTS(3)

πŸ’… MONGOC_SESSION...ANSACTION_OPTS(3) πŸŽ€

okay bestie, welcome to the libmongoc corner of the manual β€” this one's about mongoc_session_opts_get_transaction_opts, and yes the header got a little chopped up in the terminal but that's just how man pages be. no cap, it's a good one.


✨ SYNOPSIS ✨

mongoc_transaction_opt_t *
mongoc_session_opts_get_transaction_opts (
   const mongoc_client_session_t *session);

🌸 DESCRIPTION 🌸

so basically this function hands you the options for the current transaction started with this session. that's the whole vibe. 🫢

and if this session is not in a transaction? then the returned value is NULL. literally nothing, bestie, not a crash. go check mongoc_client_session_in_transaction() if you want to know for sure before you call this. iykyk. πŸ’…

πŸ¦‹ PARAMETERS πŸ¦‹

  • session β€” a mongoc_client_session_t. that's it. that's the whole list. iconic.

πŸ‘‘ RETURNS πŸ‘‘

if the session is in a transaction, you get a brand-new mongoc_transaction_opt_t, and β€” this is the important part, don't skip it β€” it must be freed with mongoc_transaction_opts_destroy(). it's giving "you break it, you bought it" energy but for memory. 😭

otherwise? NULL. as established. πŸ’€

no cap: if you forget the mongoc_transaction_opts_destroy() you're gonna have a leak and we're gonna have to have a talk.

⭐ AUTHOR ⭐

MongoDB, Inc β€” slay, ily.

2009-present, MongoDB, Inc. that's a long-run reign, honestly queen behavior. πŸ‘‘


and that's the page, bestie! 🌈✨ this was libmongoc version 2.5.6, dated Oct 09, and it's a wrap β€” mwah, bye πŸ’–πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from