# JSON array filter equals

`json-array-filter-equals` · version 1.0.0 · JSON & JSONL · free, no key needed

Filter JSON array objects where a key equals a specific value.

**Use when you need to: json array filter equals · filter json array · select json objects by value.**

## Supported

- json array filter equals
- filter json array
- select json objects by value

## Not supported

- complex expressions
- greater than
- regex matching

## Behavior

- Outputs a new array containing only the objects where the value of the specified key strictly equals (===) the target value.
- Retains original ordering of objects.

## Input

- `array` (array of object, required): max items 10000
- `key` (string, required): min length 1
- `value` (any JSON value, required)

## Output

- `result` (array of object, required)
- `count` (integer, required)

## Limits

- max array items: 10000
- max output items: 10000

## Example

Request input:

```json
{
  "array": [
    {
      "id": 1,
      "active": true
    },
    {
      "id": 2,
      "active": false
    },
    {
      "id": 3,
      "active": true
    }
  ],
  "key": "active",
  "value": true
}
```

Response:

```json
{
  "result": {
    "result": [
      {
        "id": 1,
        "active": true
      },
      {
        "id": 3,
        "active": true
      }
    ],
    "count": 2
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "json-array-filter-equals",
  "version": "1.0.0",
  "input": {
    "array": [
      {
        "id": 1,
        "active": true
      },
      {
        "id": 2,
        "active": false
      },
      {
        "id": 3,
        "active": true
      }
    ],
    "key": "active",
    "value": true
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/json-array-filter-equals/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"array":[{"id":1,"active":true},{"id":2,"active":false},{"id":3,"active":true}],"key":"active","value":true}'
```

The machine-readable contract is at [/v1/tools/json-array-filter-equals/versions/1.0.0](/v1/tools/json-array-filter-equals/versions/1.0.0).

### CLI

```sh
node cli.mjs run json-array-filter-equals 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [JSON array distinct by](/tools/json-array-distinct-by): Deduplicate a JSON array of objects based on specific keys.
- [JSON array group by](/tools/json-array-group-by): Group an array of JSON objects by exact keys.
- [JSON array sort objects](/tools/json-array-sort-objects): Stably sort an array of objects by explicit string keys using UTF-16 lexicographic order.
- [JSON array anti join](/tools/json-array-anti-join): Anti join two JSON arrays of objects on exact keys.
- [JSON array count](/tools/json-array-count): Count structural occurrences in a JSON array in first-seen order.
- [JSON array group count](/tools/json-array-group-count): Group an array of JSON objects by exact keys and return the count.
