op: add

Increment a numeric field by a value.

Allowed phases

PhaseStatus
preflight✗ forbidden
core✓ allowed
side_effects✗ forbidden

Syntax

- op: add
  path: /shows_attended
  value: 1
 
- op: add
  path: /wallet/balance
  value: "event.amount"
  cap:
    max: 10000
    min: 0

Parameters

FieldRequiredDescription
pathyesNumeric field path
valueyesAmount to add (literal or expression)
capno{ max: N, min: N } — clamp result after addition
if_missingnocreate, fail, or skip
target_streamnoCross-stream target (avoid)
target_entitynoEntity ID for cross-stream target

Behavior

  • Pair with cap: { min: 0 } to prevent negative balances or inventory.
  • If the field is missing and if_missing is create (default), the field is created starting from the added value.

sub · set

See also