> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrics-man.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitand

# \$bitAnd

The `$bitAnd` operator performs a bitwise AND operation on integer values.

## Input

* An array of integer values (at least 2 values required)

## Output

* The result of performing a bitwise AND operation on all input values

## Examples

### Basic Bitwise AND

```json theme={null}
{
  "$bitAnd": [
    5,
    3
  ]
}
```

Result: `1` (binary: 101 AND 011 = 001)

### Multiple Values

```json theme={null}
{
  "$bitAnd": [
    15,
    7,
    3
  ]
}
```

Result: `3` (binary: 1111 AND 0111 AND 0011 = 0011)

### Field Value

```json theme={null}
{
  "$bitAnd": [
    {
      "$input": "flag1"
    },
    {
      "$input": "flag2"
    }
  ]
}
```

Result: The bitwise AND of flag1 and flag2 fields
