op: map

Transform each array element and replace the array in place.

Allowed phases

PhaseStatus
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

FieldRequiredDescription
pathyesArray field path
asyesIterator name (typically it)
valueyesObject shape for each transformed element

Behavior

  • Replaces the entire array. For single-element updates, prefer find + merge.

sort · filter

See also