3 ms·
What does [.[] | x] do?
by jcims 5y ago
What does [.[] | x] do?
- swader999 5y ago.map(x)
- jcims 5y agoThis is the most jq-ish reply xD
- Varriount 5y agoTake each sub-item in `.` (the current item being processed), apply the function `x` to each sub-item, and collect all the result values from `x` into an array.
- prutschman 5y agoNot a jq expert, but my understanding is: `.[]` takes a list and turns it into a sequence consisting of each element of that list. `| x` applies the filter `x` to that sequence, turning it into a new sequence. The outermost `[ ]` builds a list from that new sequence.