---
name: "bson_copy_to_excluding"
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_excluding"
---

# bson\_copy\_to\_excluding(3)

**WARNING:**

Deprecated since version 1.1.0: Use *bson\_copy\_to\_excluding\_noinit()* instead.

## SYNOPSIS

```
void
bson_copy_to_excluding (const bson_t *src,
                        bson_t *dst,
                        const char *first_exclude,
                        ...);
```

## PARAMETERS

- •

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

- •

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

- •

  **first\_exclude**: The first field name to exclude.

## DESCRIPTION

The *bson\_copy\_to\_excluding()* function shall copy all fields from **src** to **dst** except those specified by the variadic, NULL terminated list of keys starting from **first\_exclude**.

**WARNING:**

*bson\_init()* is called on **dst**.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
