op: filter

Keep only array elements matching a where predicate (in-place).

Allowed phases

PhaseStatus
preflight✗ forbidden
core✓ allowed
side_effects✗ forbidden

Syntax

- op: filter
  path: /cart/items
  where: "it.quantity > 0"

Parameters

FieldRequiredDescription
pathyesArray field path
whereyesPlain string; it = current element

Behavior

  • Inverse of remove: matching elements are kept. where is a plain string.

remove · map

See also