3 ms·
So, how does one iterate over an array in jq? Asking for a friend.
by NoSalt 6mo ago
So, how does one iterate over an array in jq? Asking for a friend.
- wwader 6mo agoAssume input is an array you can do it several ways depending on what you want: # output each value in the array separately .[] # output each value but transform it in some way .[] | . * 2 # map each value into a new array map(. * 2) # same as above but manual iterate/collect [.[] | . * 2]