---
name: "mongoc_transaction_opts_set_read_prefs"
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_transaction_opts_set_read_prefs"
---

# mongoc\_transaction\_opts\_set\_read\_prefs(3)

## SYNOPSIS

```
void
mongoc_transaction_opts_set_read_prefs (mongoc_transaction_opt_t *opts,
                                        const mongoc_read_prefs_t *read_prefs);
```

Configure the transaction's read preference. The argument is copied into the struct and can be freed after calling this function.

## PARAMETERS

- •

  **opts**: A *mongoc\_transaction\_opt\_t*.

- •

  **read\_prefs**: A *mongoc\_read\_prefs\_t*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
