---
name: "mongoc_client_session_append"
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_client_session_append"
---

# mongoc\_client\_session\_append(3)

## SYNOPSIS

```
bool
mongoc_client_session_append (const mongoc_client_session_t *client_session,
                              bson_t *opts,
                              bson_error_t *error);
```

## PARAMETERS

- •

  **client\_session**: A pointer to a *mongoc\_client\_session\_t*.

- •

  **opts**: A pointer to a *bson\_t*.

- •

  **error**: An optional location for a *bson\_error\_t* or **NULL**.

## DESCRIPTION

This function appends a logical session id to command options. Use it to configure a session for any function that takes an options document, such as *mongoc\_client\_write\_command\_with\_opts()*.

It is an error to use a session for unacknowledged writes.

## RETURNS

Returns true on success. If any arguments are invalid, returns false and fills out **error**.

## EXAMPLE

See the example code for *mongoc\_client\_session\_t*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
