MONGOC_SESSION...ANSACTION_OPTS(3)
Hey bestie π this is the libmongoc manual page for mongoc_session_opts_set_default_transaction_opts() β the one that sets your sessionβs default transaction options, and itβs lowkey iconic. β¨
β¨ SYNOPSIS β¨
void
mongoc_session_opts_set_default_transaction_opts (
mongoc_session_opt_t *opts, const mongoc_transaction_opt_t *txn_opts);
Okay so what it does: it sets the default options for transactions started with this session. The txn_opts argument is copied and can be freed after calling this function β it made its own copy, bestie, so youβre free to let it go. π«Ά
When a session is first created with mongoc_client_start_session(), it inherits from the client the read concern, write concern, and read preference with which to start transactions. Each of these fields can be overridden independently.
Create a mongoc_transaction_opt_t with mongoc_transaction_opts_new(), and pass a non-NULL option to any of these mongoc_transaction_opt_t setter functions:
mongoc_transaction_opts_set_read_concern()mongoc_transaction_opts_set_write_concern()mongoc_transaction_opts_set_read_prefs()
Pass the resulting transaction options to mongoc_session_opts_set_default_transaction_opts(). Each field set in the transaction options overrides the inherited client configuration. And there is an opportunity to override each one of these fields again by passing a mongoc_transaction_opt_t to mongoc_client_session_start_transaction(). Layers, bestie β itβs giving options-on-options. π
πΈ PARAMETERS πΈ
optsβ Amongoc_session_opt_t.txn_optsβ Amongoc_transaction_opt_t.
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
Okay thatβs the whole page, no notes. This libmongoc page comes from source/version 2.5.6, dated Oct 09, 202 in the footer (yes, it really runs right into the page title like that π), and itβs serving full manual-page main character energy. Bye πβ¨
π¦ 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