Has
Has map key
- a: yes
- a: ~
- a:
- b: nopeyq '.[] | has("a")' sample.ymltrue
true
true
falseSelect, checking for existence of deep paths
Has array index
Last updated
- a: yes
- a: ~
- a:
- b: nopeyq '.[] | has("a")' sample.ymltrue
true
true
falseLast updated
- a:
b:
c: cat
- a:
b:
d: dogyq '.[] | select(.a.b | has("c"))' sample.ymla:
b:
c: cat- []
- [1]
- [1, 2]
- [1, null]
- [1, 2, 3]
yq '.[] | has(1)' sample.ymlfalse
false
true
true
true