---
name: "bson_iter_key"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_iter_key"
---

# bson\_iter\_key(3)

## SYNOPSIS

```
const char *
bson_iter_key (const bson_iter_t *iter);
```

## PARAMETERS

- •

  **iter**: A *bson\_iter\_t*.

## DESCRIPTION

Fetches the key for the current element observed by **iter**.

## RETURNS

A string which should not be modified or freed.

**SEE ALSO:**

```
bson_iter_key_len() to retrieve the length of the key in constant time.
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
