mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-24 14:45:39 +00:00
685 B
685 B
Equal Operator
Examples
Example 0
sample.yml:
[cat,goat,dog]
Expression
yq '.[] | (. == "*at")' < sample.yml
Result
true
true
false
Example 1
sample.yml:
[3, 4, 5]
Expression
yq '.[] | (. == 4)' < sample.yml
Result
false
true
false
Example 2
sample.yml:
a: { cat: {b: apple, c: whatever}, pat: {b: banana} }
Expression
yq '.a | (.[].b == "apple")' < sample.yml
Result
true
false
Example 3
Expression
yq 'null == null' < sample.yml
Result
true
Example 4
Expression
yq 'null == ~' < sample.yml
Result
true