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

# Zen Parse Expression

> Evaluate Zen expressions or unary conditions against input data

The Zen Parse Expression command (Command Type: 1020) evaluates [Zen expressions](https://github.com/gorules/zen) or unary conditions against the current input data context.

## Overview

The Zen Parse Expression command provides functionality for:

* Evaluating `expression` type Zen expressions that return transformed data
* Evaluating `unary` type boolean conditions against the root context (`$`)
* Storing results in the `data` field or `children` array

## Command Type

**Command Type ID:** 1020

## Parameters

| Parameter          | Type   | Description                                                                                                                                                        | Required |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| **evaluationType** | string | The type of evaluation. `"expression"` returns transformed data; `"unary"` evaluates a boolean condition against `$`. Possible values: `"expression"`, `"unary"`   | Yes      |
| **expression**     | string | The Zen expression to evaluate. For `expression`: use object construction like `( key: value )`. For `unary`: use boolean conditions like `$.value > 10`           | Yes      |
| **timeout**        | number | Timeout for the evaluation in milliseconds                                                                                                                         | Yes      |
| **key**            | string | Where to store the result. `"data"` (default) stores in data field; `"children"` stores in children array (must be array). Possible values: `"data"`, `"children"` | No       |

## Usage Examples

### Evaluate an Expression

```json theme={null}
{
  "command": "zen-parse",
  "params": {
    "evaluationType": "expression",
    "expression": "( id: $.eventId, name: $.eventName )",
    "timeout": 5000
  }
}
```

### Evaluate a Unary Condition

```json theme={null}
{
  "command": "zen-parse",
  "params": {
    "evaluationType": "unary",
    "expression": "$.odds > 1.5",
    "timeout": 3000
  }
}
```

### Output to Children Array

```json theme={null}
{
  "command": "zen-parse",
  "params": {
    "evaluationType": "expression",
    "expression": "$.items.( id: id, label: name )",
    "timeout": 5000,
    "key": "children"
  }
}
```

## Evaluation Types

| Type         | Description                                                        | Expression Example                   |
| ------------ | ------------------------------------------------------------------ | ------------------------------------ |
| `expression` | Returns transformed data using object construction syntax          | `( id: $.id, value: $.price * 1.1 )` |
| `unary`      | Returns a boolean — evaluates a condition against root context `$` | `$.status = 'active'`                |

## Output Key Options

| Value        | Behaviour                                                           |
| ------------ | ------------------------------------------------------------------- |
| `"data"`     | Stores the result in the `data` field (default)                     |
| `"children"` | Stores the result in the `children` array — result must be an array |

## Common Use Cases

* **Conditional Filtering**: Use unary mode to evaluate pass/fail conditions in the pipeline
* **Data Reshaping**: Use expression mode to produce a new object structure
* **Lightweight Transforms**: Apply simple Zen expressions without the full JDM graph overhead

## Related Commands

* [JSONata](/stream/commands/parse/jsonata) - Evaluate JSONata expressions against input data
* [Transform By JDM](/stream/commands/parse/transform) - Transform data using full JDM rules
* [Filter](/stream/commands/parse/filter) - Filter collections based on field values
