Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
hyperthesis
2y ago
0 comments
Save
Share
For their
pick()
example:
jq -n '{"a": 1, "b": {"c": 2, "d": 3}, "e": 4} | pick(.a, .b.c, .x)
wouldn't a more jq-y syntax be:
| {a, b.c, x}
(which fails on the 'b.c' term)
0 comments
1 comments · 1 top-level
top
newest
oldest
wwader
2y ago
yeap that could be an extension of the shorthand syntax, but note that pick/1 also works with any "path expression" ex: pick(if .a then .b.c else .x end)
j
/
k
navigate · click thread line to collapse