json - How to check if element exists in array with jq -
i have array , need check if elements exists in array or element array using jq, fruit.json:
{ "fruit": [ "apple", "orange", "pomegranate", "apricot", "mango" ] } cat fruit.json | jq '.fruit .apple' does not work
cat fruit.json | jq '.fruit' | jq 'contains(["orange"])'
Comments
Post a Comment