---
name: "mongoc_session_opts_get_transaction_opts"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_session_opts_get_transaction_opts"
---

# mongoc\_session\_opts\_get\_transaction\_opts(3)

## SYNOPSIS

```
mongoc_transaction_opt_t *
mongoc_session_opts_get_transaction_opts (
   const mongoc_client_session_t *session);
```

The options for the current transaction started with this session.

If this **session** is not in a transaction, then the returned value is **NULL**. See *mongoc\_client\_session\_in\_transaction()*.

## PARAMETERS

- •

  **session**: A *mongoc\_client\_session\_t*.

## RETURNS

If the session is in a transaction, a new *mongoc\_transaction\_opt\_t* that must be freed with *mongoc\_transaction\_opts\_destroy()*. Otherwise, **NULL**.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
