This is the first part of an ongoing series on mastering jq. jq is a valuable tool that every fast coder has in their tool chest. It contains depths of immense power. In part 1, we'll start off with the basics.
Two inputs that'll come in handy when you use jq all the time:
1. "." is the default query, so instead of `jq '.'` you could just write `jq`.
2. Each occurence of ` | .` in a jq query can be ommited, so the `jq '.k1 | .[0] | .k2 | .[0]'` can be rewritten as `jq '.k1[0].k2[0]'` - for this example, writing the extended version is probably better to explain how it works, but I think it's worth noting that |. can be removed for brevity.
the very last example should use "jq -r" instead of "jq -R"
nice catch, fixed
thanks for the article!
jqterm.com is a good place to practice jq skills.
Nice article, very good starting point!
Two inputs that'll come in handy when you use jq all the time:
1. "." is the default query, so instead of `jq '.'` you could just write `jq`.
2. Each occurence of ` | .` in a jq query can be ommited, so the `jq '.k1 | .[0] | .k2 | .[0]'` can be rewritten as `jq '.k1[0].k2[0]'` - for this example, writing the extended version is probably better to explain how it works, but I think it's worth noting that |. can be removed for brevity.
The font for your letter l looks like a one to me, e.g. here: “a json array and l >= m, the subarray is returned“
It quite confused me at first
Thanks for raising this, I changed the font to make it more clear.
sure!