---
name: "bson_copy_to"
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_copy_to"
---

# bson\_copy\_to(3)

## SYNOPSIS

```
void
bson_copy_to (const bson_t *src, bson_t *dst);
```

## PARAMETERS

- •

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

- •

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

## DESCRIPTION

The *bson\_copy\_to()* function shall initialize **dst** with a copy of the contents of **src**.

**dst** *MUST* be an uninitialized *bson\_t* to avoid leaking memory.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
