I have an array and I need to check if elements exists in that array or to get that element from the array using jq, fruit.json:
{
\"fr
For future visitors, if you happen to have the array in a variable and want to check the input against it, and you have jq 1.5 (without IN), your best option is index
but with a second variable:
.inputField as $inputValue | $storedArray|index($inputValue)
This is functionally equivalent to .inputField | IN($storedArray[])
.