Skip to content

Instantly share code, notes, and snippets.

Last active March 3, 2022 10:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nichtich/976d7ac8a5fcc2e896cc86795f2ee416 to your computer and use it in GitHub Desktop.
JSON query languages

JSON query languages

  • JSONPath is was created 2007, inspired by XPath. A formal standard is being created at
  • SQL/JSON path was created inspired by JSONPath and other query languages.
  • jq is a programming language with strong support of JSON transformation
  • JSON Pointer only references a single element

Most important conflicting difference between JSONPath and SQL/JSON path is $.["name"] vs $."name" and $[? filter ] vs $?(filter).

Other JSON query languages

  • JAQL
  • JMESPath
  • JSONata
  • JSONiq
  • JSONPath

Minimal subset of JSONPath (JSON Basic Path)

  • No filter expression
  • No list selector
  • No array slice
  • No functions
  • No Descendant Selector
json-basic-path = root-selector *(S (dot-selector        /
                               dot-wild-selector   /
                               index-selector      /
                               index-wild-selector ))
$."name" not allowed in JSONPath !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment