jq: tested guides
Hands-on jq guides, each written after reproducing the problem ourselves.
-
jq select with contains: Why It Matches Too Much, and What to Use
Tested on jq 1.8.2, 1.7.1 and macOS's 1.6: contains() matches substrings inside arrays and objects, and one null field ends the run. Exact-match filters.
Guide -
jq Edit JSON In Place: Update a File Without Emptying It
jq has no -i flag, and > file.json empties the file. Tested on jq 1.8.2, 1.7.1 and macOS's jq: a safe write-back function, and where temp+mv still fails.
Fix -
jq JSON to CSV: @csv Errors, Headers and Nulls, Tested
Tested on jq 1.8.2, 1.7.1 and macOS's 1.6: why @csv says "only array" or "not valid in a csv row", how to add a header, and when columns silently vanish.
Fix -
jq: Merge Two JSON Files by Key, Tested on 3 Versions
Tested on jq 1.8.2, 1.7.1 and macOS's 1.6: -s add is a shallow merge, input * input merges backwards, and --argfile is gone since 1.7. What works.
Guide