---
name: "mongoc_client_session_get_server_id"
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_get_server_id"
---

# mongoc\_client\_session\_get\_server\_id(3)

## SYNOPSIS

```
uint32_t
mongoc_client_session_get_server_id (const mongoc_client_session_t *session);
```

Get the "server ID" of the **mongos** this *mongoc\_client\_session\_t* is pinned to.

## PARAMETERS

- •

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

## RETURNS

A server ID or **0** if this *mongoc\_client\_session\_t* is not pinned.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
