News for hackers. Stuff that matters.
Re:jq 1.7 released by black_puppydog on Wednesday September 06, 2023 @10:28PM (#37414017)
> 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

Re:jq 1.7 released by nivekastoreth on Wednesday September 06, 2023 @10:40PM (#37414093)
This 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
Re:jq 1.7 released by nnutter on Wednesday September 06, 2023 @10:40PM (#37414097)
I just installed from Git the other day to use this feature. It’s very useful!
Re:jq 1.7 released by wwader on Thursday September 07, 2023 @04:46AM (#37416305)
If 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
  }