> ## 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.

# Leftshift

# \$bitLeftShift

The `$bitLeftShift` operator performs a bitwise left shift operation on the first integer by the second integer number of positions.

## Input

* An array containing exactly two integer values: the value to shift and the number of positions to shift

## Output

* The result of shifting the first value left by the specified number of positions

## Examples

### Basic Left Shift

```json theme={null}
{
  "$bitLeftShift": [
    5,
    1
  ]
}
```

Result: `10` (binary: 101 "left shift" 1 = 1010)

### Multiple Position Shift

```json theme={null}
{
  "$bitLeftShift": [
    3,
    2
  ]
}
```

Result: `12` (binary: 011 "left shift" 2 = 1100)

### Field Value

```json theme={null}
{
  "$bitLeftShift": [
    {
      "$input": "value"
    },
    {
      "$input": "positions"
    }
  ]
}
```

Result: The value field left-shifted by the positions field
