Go JSONPath Playground

About

About

This is the playground for github.com/theory/jsonpath, a Go package that executes RFC 9535 JSONPath queries to select values from arbitrary JSON data.

The playground runs entirely in the browser thanks to TinyGo, which compiles the github.com/theory/jsonpath package into Web Assembly.

Learn more about JSONPath by reading the IETF JSONPath Standard, and more about github.com/theory/jsonpath by following the links at the bottom of the page. The code for this website can be found on GitHub.

JSONPath Expressions

JSONPath Expressions

Syntax Element Description
$ root node identifier
@ current node identifier (valid only within filter selectors)
[<selectors>] child segment: selects zero or more children of a node
.name shorthand for ['name']
.* shorthand for [*]
..[<selectors>] descendant segment: selects zero or more descendants of a node
..name shorthand for ..['name']
..* shorthand for ..[*]
'name' or "name" name selector: selects a named child of an object
* wildcard selector: selects all children of a node
3 index selector: selects an indexed child of an array (from 0)
0:100:5 array slice selector: start:end:step for arrays
?<logical-expr> filter selector: selects particular children using a logical expression
length(@.foo) function extension: invokes a function in a filter expression