op: set

Set a field to a value, overwriting any existing value.

Allowed phases

PhaseStatus
preflight✗ forbidden
core✓ allowed
side_effects✗ forbidden

Syntax

- op: set
  path: /status
  value: purchased
 
- op: set
  path: /cart/total
  value: "sum(map(entity.cart.items ?: [], 'quantity * price')) ?: 0"

Parameters

FieldRequiredDescription
pathyesField path in slash notation (/cart/total)
valueyesLiteral or expression string
if_missingnocreate (default), fail, or skip when path does not exist
target_streamnoCross-stream write — avoid; prefer submit in side_effects
target_entitynoEntity ID expression when using target_stream

Behavior

  • Runs in core only. Direct cross-stream set is discouraged — use submit to invoke an action on the target entity.
  • Nested object paths use slash notation in path and dot notation in expressions (entity.cart.total).
  • Use if_missing: fail when the field must already exist; skip to no-op when absent.

add · unset · merge

See also