---
name: "bson_iter_bool"
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_bool"
---

# bson\_iter\_bool(3)

## SYNOPSIS

```
#define BSON_ITER_HOLDS_BOOL(iter) (bson_iter_type ((iter)) == BSON_TYPE_BOOL)
bool
bson_iter_bool (const bson_iter_t *iter);
```

## PARAMETERS

- •

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

## DESCRIPTION

The **bson\_iter\_bool()** function shall return the boolean value of a BSON\_TYPE\_BOOL element. It is a programming error to call this function on an element other than BSON\_TYPE\_BOOL. You can check this with *bson\_iter\_type()* or **BSON\_ITER\_HOLDS\_BOOL()**.

## RETURNS

Either **true** or **false**.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
