op: sub
Decrement a numeric field by a value.
Allowed phases
| Phase | Status |
|---|---|
preflight | ✗ forbidden |
core | ✓ allowed |
side_effects | ✗ forbidden |
Syntax
- op: sub
path: /inventory/stock
value: "event.quantity"
cap:
min: 0Parameters
| Field | Required | Description |
|---|---|---|
path | yes | Numeric field path |
value | yes | Amount to subtract |
cap | no | { max: N, min: N } — clamp result |
if_missing | no | create, fail, or skip |
Behavior
- Same parameters as
add. Usecap: { min: 0 }to prevent negatives.
Related operations
See also
- Operations index — all ops by phase
- actions — rule structure and phases
- Intents: Rules — narrative examples