How check if there is an array or an object in jq?
Use the type function: type The type function returns the type of its argument as a string, which is one of null, boolean, number, string, array or object. Example 1: echo ‘[0, false, [], {}, null, “hello”]’ | jq ‘map(type)’ [ “number”, “boolean”, “array”, “object”, “null”, “string” ] Example 2: echo ‘[0,1]’ | jq ‘if … Read more