How to check if element exists in array with jq
The semantics of ‘contains’ is not straightforward at all. In general, it would be better to use ‘index’ to test if an array has a specific value, e.g. .fruit | index( “orange” ) However, if the item of interest is itself an array, the general form: ARRAY | index( [ITEM] ) should be used, e.g.: … Read more