3 ms·
> Adds new builtin pick(stream) to emit a projection of the input object or array. > jq -n '{"a": 1, "b": {"c": 2, "d": 3}, "e": 4} | pick(.a, .b.c, .x)' This
by black_puppydog 3y ago
> Adds new builtin pick(stream) to emit a projection of the input object or array.
> jq -n '{"a": 1, "b": {"c": 2, "d": 3}, "e": 4} | pick(.a, .b.c, .x)'
This is a godsend! Thanks to the contributors! <3
- nivekastoreth 3y agoThis is a fantastic new feature. I would also love a version of ‘pick’ that works on streaming data, since that doesn’t seem to be possible currently without reassembling the stream first
- nnutter 3y agoI just installed from Git the other day to use this feature. It’s very useful!
- wwader 3y agoIf you don't need to digg deep it's also possible to do: $ jq -n '{"a": 1, "b": {"c": 2, "d": 3}, "e": 4} | {a, e}' { "a": 1, "e": 4 }