op: map
Transform each array element and replace the array in place.
Allowed phases
| Phase | Status |
|---|---|
preflight | ✗ forbidden |
core | ✓ allowed |
side_effects | ✗ forbidden |
Syntax
- op: map
path: /items
as: it
value:
sku: "it.sku"
qty: "it.qty"
subtotal: "it.qty * it.price"Parameters
| Field | Required | Description |
|---|---|---|
path | yes | Array field path |
as | yes | Iterator name (typically it) |
value | yes | Object shape for each transformed element |
Behavior
- Replaces the entire array. For single-element updates, prefer
find+merge.
Related operations
See also
- Operations index — all ops by phase
- actions — rule structure and phases
- Intents: Rules — narrative examples