---
name: "mongoc_bulk_operation_set_client_session"
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_bulk_operation_set_client_session"
---

# mongoc\_bulk\_operation\_set\_client\_session(3)

## SYNOPSIS

```
void
mongoc_bulk_operation_set_client_session (
  mongoc_bulk_operation_t *bulk,
  mongoc_client_session_t *client_session);
```

Sets an explicit client session to use for the bulk operation.

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

## PARAMETERS

- •

  **bulk**: A *mongoc\_bulk\_operation\_t*.

- •

  **client\_session**: A *mongoc\_client\_session\_t*. Must be derived from the same *mongoc\_client\_t* as **bulk**.

**SEE ALSO:**

```
mongoc_client_start_session()
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
