---
name: "bson_append_iter"
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_append_iter"
---

# bson\_append\_iter(3)

## SYNOPSIS

```
bool
bson_append_iter (bson_t *bson,
                  const char *key,
                  int key_length,
                  const bson_iter_t *iter);
```

## PARAMETERS

- •

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

- •

  **key**: Optional field name. If NULL, uses *bson\_iter\_key(iter)*.

- •

  **key\_length**: The length of **key** or -1 to use strlen().

- •

  **iter**: A *bson\_iter\_t* located on the position of the element to append.

## DESCRIPTION

Appends the value at the current position of **iter** to the document.

## RETURNS

Returns **true** if successful; **false** if the operation would overflow the maximum document size or another invalid state is detected.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
