---
name: "bson_get_data"
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_get_data"
---

# bson\_get\_data(3)

## SYNOPSIS

```
const uint8_t *
bson_get_data (const bson_t *bson);
```

## PARAMETERS

- •

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

## DESCRIPTION

The *bson\_get\_data()* function shall return the raw buffer of a bson document. This can be used in conjunction with the **len** property of a *bson\_t* if you want to copy the raw buffer around.

## RETURNS

A buffer which should not be modified or freed.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
