---
name: "bson_count_keys"
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_count_keys"
---

# bson\_count\_keys(3)

## SYNOPSIS

```
uint32_t
bson_count_keys (const bson_t *bson);
```

## PARAMETERS

- •

  **bson**: A *bson\_t*.

## DESCRIPTION

The *bson\_count\_keys()* function shall count the number of elements within **bson**.

## RETURNS

A positive integer or zero.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
