1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Added any_c and all_c operators

This commit is contained in:
Mike Farah
2021-05-14 15:01:44 +10:00
parent 8e14b3b393
commit f4392f8658
9 changed files with 127 additions and 71 deletions

View File

@@ -4,4 +4,6 @@ The `or` and `and` operators take two parameters and return a boolean result.
`any` will return `true` if there are any `true` values in a array sequence, and `all` will return true if _all_ elements in an array are true.
These are most commonly used with the `select` operator to filter particular nodes.
`any_c(condition)` and `all_c(condition)` are like `any` and `all` but they take a condition expression that is used against each element to determine if it's `true`. Note: in `jq` you can simply pass a condition to `any` or `all` and it simply works - `yq` isn't that clever..yet
These are most commonly used with the `select` operator to filter particular nodes.