---
name: "bson_iter_recurse"
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_iter_recurse"
---

# bson\_iter\_recurse(3)

## SYNOPSIS

```
bool
bson_iter_recurse (const bson_iter_t *iter, bson_iter_t *child);
```

## PARAMETERS

- •

  **iter**: A *bson\_iter\_t*.

- •

  **child**: A *bson\_iter\_t*.

## DESCRIPTION

The *bson\_iter\_recurse()* function shall initialize **child** using the embedded document or array currently observed by **iter**.

If there was a failure to initialize the **iter**, false is returned and both **iter** and **child** should be considered invalid.

This should only be called when observing an element of type BSON\_TYPE\_ARRAY or BSON\_TYPE\_DOCUMENT.

## RETURNS

If **iter** observes an element of type BSON\_TYPE\_ARRAY or BSON\_TYPE\_DOCUMENT, then **child** is initialized and the function returns **true**. Otherwise, the function returns **false** and **child** is invalid.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
