MONGOC_CLIENT_...IT_TRANSACTION(3)

πŸŽ€ MONGOC_CLIENT_...IT_TRANSACTION(3) πŸŽ€

okay bestie so this page lives in the libmongoc manual β€” it's the mongoc_client_session_commit_transaction() page, and the title got truncated by the man-page gods (the header literally reads MONGOC_CLIENT_...IT_TRANSACTION(3)), but dw, we know what it is πŸ’…


✨ SYNOPSIS ✨

bool
mongoc_client_session_commit_transaction (mongoc_client_session_t *session,
                                          bson_t *reply,
                                          bson_error_t *error);

So the vibe here is: commit a multi-document transaction. that's the whole personality ✨ like you built the whole little transaction and now you're hitting send, periodt.


πŸ’– PARAMETERS πŸ’–

  • session β€” a mongoc_client_session_t. your session. your main character. 🫢
  • reply β€” a maybe-NULL pointer to overwritable storage for a bson_t that'll hold the results. if you pass it, it catches the outcome πŸ’Œ
  • error β€” an optional spot to put a bson_error_t, or NULL if you're built different and don't want to hear about it πŸ™ˆ

🌸 RETURN 🌸

Returns true if the transaction was committed. slay, congrats, it's giving success 🌈

Returns false and sets error if there are invalid arguments β€” for example a session that has no transaction in progress (😭 not the empty transaction) β€” or if there's a server or network error. so basically if anything goes sideways, you get false + the error filled in.

⚠️ important one, bestie: if a reply is supplied, it is always initialized, and you must free it with bson_destroy(). every time. no cap. don't leak on me πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” iconic behavior honestly


2009-present, MongoDB, Inc.


and that's the whole page, bestie πŸŽ€ written by the libmongoc girlies β€” version 2.5.6, dated Oct 09, 202 (yes the date literally collided with the header text, we love a dramatic entrance πŸ’€βœ¨). go commit those transactions, you're doing amazing sweetie πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from