Path.query

Queries a JSON tree using a JSONPath expression.

This function is a simple wrapper around json.path.Path.new_, json.path.Path.compile, and json.path.Path.match. It implicitly creates a json.path.Path instance, compiles the given expression and matches it against the JSON tree pointed by root.

class Path
static
query

Parameters

expression string

a JSONPath expression

root json.node.Node

the root of a JSON tree

Return Value

Type: json.node.Node

a newly-created node of type json.types.NodeType.Array containing the array of matching nodes