---
name: "mongoc_client_session_destroy"
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_destroy"
---

# mongoc\_client\_session\_destroy(3)

## SYNOPSIS

```
void
mongoc_client_session_destroy (mongoc_client_session_t *session);
```

End a session, returning its session id to the pool, and free all client resources associated with the session. If a multi-document transaction is in progress, abort it. Does nothing if **session** is NULL.

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

## PARAMETERS

- •

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

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
