I want to select elements >= 3 in an array like [2, 4, 3]
with jq
, how do I do it?
I have found answers when the array contains objects (e.g [{Name:"a", Age:2} ...]}
) with things like select (.Age >= 2)
but I don't know how to refer to values
Use
.
.If you want to retain the array structure, you could use
map(select(_))
, e.g.If you just want the values, you could consider: