Loading tool…
cheatsheet
cat data.json | jq '.'Pretty-print JSON (identity filter)
cat data.json | jq '.key'Access a specific key
cat data.json | jq '.array[0]'Access an element in an array by index
cat data.json | jq '.[].name'Iterate over an array of objects and get 'name'
cat data.json | jq '.key1, .key2'Get multiple keys (comma-separated)
cat data.json | jq '.[] | select(.status == "active")'Filter array elements based on condition
cat data.json | jq '{name: .user.name, id: .user.id}'Create a new object from existing data
cat data.json | jq '.[] | {id, name}'Shorthand for creating objects with same-named fields
cat data.json | jq '.[] | . + {new_key: "new_value"}'Add a new key-value pair to each object in an array
cat data.json | jq 'map(.id)'Extract a specific field from all objects in an array
cat data.json | jq '[.array[] | .value]'Extract values into a new array
cat data.json | jq 'length'Get the length of an array or object
cat data.json | jq '.[] | length'Get length of each item in array (if items are arrays/objects)
cat data.json | jq '.text | ascii_downcase'Convert string to lowercase
cat data.json | jq '.price | tonumber'Convert string to number
cat data.json | jq '.count + 10'Perform arithmetic operations
cat data.json | jq 'del(.sensitive_data)'Delete a field from an object
cat data.json | jq 'del(.[] | select(.id == 1))'Delete an element from an array by condition
cat data.json | jq 'if .status == "active" then "Active" else "Inactive" end'Conditional logic
Get new cheatsheets & tools in your inbox
No spam — just new releases, occasionally.