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

# Find

# \$find

The `$find` operator finds the first element in an array that matches a provided condition.

## Input

* An array containing an array to search and a condition to evaluate for each element

## Output

* The first element that satisfies the condition, or null if no element matches

## Examples

### Find Even Number

```json theme={null}
{
  "$find": [
    [1, 2, 3, 4, 5, 6],
    {
      "$eq": [
        {
          "$mod": [
            {
              "$var": ["current"]
            },
            2
          ]
        },
        0
      ]
    }
  ]
}
```

Result: `2`

### Find Object by Property

```json theme={null}
{
  "$find": [
    [
      {"name": "Alice", "age": 25},
      {"name": "Bob", "age": 30},
      {"name": "Charlie", "age": 35}
    ],
    {
      "$eq": [
        {
          "$var": ["current"]
        },
        {
          "$input": "name"
        },
        "Bob"
      ]
    }
  ]
}
```

Result: `{"name": "Bob", "age": 30}`
