All Cheat SheetsJSON
JSONPath & jq Cheat Sheet
Filter and extract JSON with path expressions and jq idioms
Core selectors
RootEntire document
$ # JSONPath
. # jqChild
$.store.book
.store.bookIndex
$.store.book[0]
.store.book[0]Wildcard
$.store.book[*].author
.store.book[].authorRecursive
$..price
.. | .price? // emptyFilters
Compare
$.store.book[?(@.price < 10)]
.store.book[] | select(.price < 10)Exists
$..book[?(@.isbn)]
.. | objects | select(has("isbn"))Slice
$.store.book[0:2]
.store.book[0:2]Handy jq transforms
Keys
keysMap fields
.store.book[] | {title, price}Length
.store.book | lengthPrettyPipe JSON into jq for formatting
.