op: sub

Decrement a numeric field by a value.

Allowed phases

PhaseStatus
preflight✗ forbidden
core✓ allowed
side_effects✗ forbidden

Syntax

- op: sub
  path: /inventory/stock
  value: "event.quantity"
  cap:
    min: 0

Parameters

FieldRequiredDescription
pathyesNumeric field path
valueyesAmount to subtract
capno{ max: N, min: N } — clamp result
if_missingnocreate, fail, or skip

Behavior

  • Same parameters as add. Use cap: { min: 0 } to prevent negatives.

add · set

See also