---
name: "bson_iter_array"
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_array"
---

# bson\_iter\_array(3)

## SYNOPSIS

```
#define BSON_ITER_HOLDS_ARRAY(iter) (bson_iter_type ((iter)) == BSON_TYPE_ARRAY)
void
bson_iter_array (const bson_iter_t *iter,
                 uint32_t *array_len,
                 const uint8_t **array);
```

## PARAMETERS

- •

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

- •

  **array\_len**: A location for the buffer length.

- •

  **array**: A location for the immutable buffer.

## DESCRIPTION

The **bson\_iter\_array()** function shall retrieve the raw buffer of a sub-array from **iter**. **iter** *MUST* be on an element that is of type BSON\_TYPE\_ARRAY. This can be verified with *bson\_iter\_type()* or the **BSON\_ITER\_HOLDS\_ARRAY()** macro.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
