Transform JSON Reliably with jq
8 steps · about 3 h 5 min · Beginner
- Run the first jq filters (guide, jq, 25 min)
Format JSON, select fields and send a document through a simple command-line pipeline.
- Navigate values and arrays (reference, jq, 25 min)
Use identity, object lookup, array indexing and iteration without converting data to text prematurely.
- Preserve JSON types (reference, jq, 20 min)
Distinguish null, booleans, numbers, strings, arrays and objects during transformations.
- Iterate nested structures (reference, jq, 20 min)
Expand arrays and objects into a stream that later filters can select and combine.
- Map values into a new shape (reference, jq, 25 min)
Apply a filter across collections and construct the output structure explicitly.
- Filter records by conditions (reference, jq, 20 min)
Select only records that satisfy typed comparisons and compound boolean rules.
- Aggregate a stream (reference, jq, 25 min)
Reduce records into counts, totals or indexed objects without an external script.
- Produce safe shell output (reference, jq, 25 min)
Choose raw, compact, sorted and null-input modes deliberately and check the exit status.