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

# Rightshift

# \$bitRightShift

The `$bitRightShift` operator performs a bitwise right 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 right by the specified number of positions

## Examples

### Basic Right Shift

```json theme={null}
{
  "$bitRightShift": [
    10,
    1
  ]
}
```

Result: `5` (binary: 1010 "right shift" 1 = 0101)

### Multiple Position Shift

```json theme={null}
{
  "$bitRightShift": [
    12,
    2
  ]
}
```

Result: `3` (binary: 1100 "right shift" 2 = 0011)

### Field Value

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

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