JSONPath Tools and Libraries

JSONPath across Command-Line Tools and Libraries

"JSONPath" on a product page rarely means RFC 9535. One question, which books in order 2 have a quantity above 1, shows the spread:

One question, four JSON query dialectsPython
ORDER=$(sed -n 2p data/orders.jsonl)                      # order 2, three line items
echo "$ORDER" | python -c 'import json, sys, jsonpath
print("python-jsonpath", jsonpath.findall("$.items[?@.qty > 1].book_id", json.load(sys.stdin)))'
echo "$ORDER" | jq -r '"jq              \([.items[] | select(.qty > 1) | .book_id])"'
duckdb -noheader -list -c "SELECT 'duckdb', json_extract('$ORDER', '\$.items[*].book_id')"
docker exec l2-pg03 psql -U postgres -XAt -c "SELECT 'postgresql',
  jsonb_path_query_array('$ORDER', '\$.items[*] ? (@.qty > 1).book_id')"
Output
python-jsonpath [3, 6]
jq              [3,6]
duckdb|[3, 6, 5]
postgresql|[3, 6]

DuckDB 1.5.5 61,228 's paths support wildcards and .. but no filters. PostgreSQL 18 1,289 implements the SQL standard's SQL/JSON path language, with filters written ? (@.qty > 1) after a step. The popular pre-RFC library jsonpath-ng 1.8.0 raises JsonPathParserError on RFC 9535 function calls.