2 ms·
When would this be better than curl https://example.com/api/orders | jq '.data[] | {date, amount}' or curl https://example.com/api/orders | jq '[.dat
by pcthrowaway 3y ago
When would this be better than
curl https://example.com/api/orders | jq '.data[] | {date, amount}'
or
curl https://example.com/api/orders | jq '[.data[] | {date, amount}]'
if you want it collected back into an array?
- wwader 3y agoIn that case it would be very similar but pick is more general then the shorthand object literal syntax, it can be used with nested index lika .a.b.c or any expression like pick(if .a then .b else .c end) but both has it uses i think.