Skip to content

Bars Specification 0.1.0 — Transform: where

Category: list · Since: 0.1.0

Filters to elements matching a predicate.

Filters to elements (structs) matching a predicate: with value, elements whose property string-equals value; with no value, elements whose property is truthy.

Input coercion: list

Arguments

Name Type Optional Default
property string no
value string yes

Arity: 1–2

Worked examples

{{ items | where: "k" "a" }}

[{"k":"a","v":1}]
{{ items | where: "on" }}

[{"on":true,"id":1}]

Full fixture: transforms/transform-where.json