You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Match the given root and current JSON data structures against this instance.
69
-
For each match, yield an instance of the `jsonpath2.Node.MatchData` class.
69
+
For each match, yield an instance of the `jsonpath2.node.MatchData` class.
70
70
71
71
#### `tojsonpath()` instance method
72
72
73
73
Returns the string representation of this instance.
74
74
75
75
### `MatchData` class
76
76
77
-
The `jsonpath2.Node.MatchData` class represents the JSON value and context for a JSONPath match.
77
+
The `jsonpath2.node.MatchData` class represents the JSON value and context for a JSONPath match.
78
78
79
79
This class is constructed with respect to a root JSON value, a current JSON value, and an abstract syntax tree node.
80
80
@@ -111,10 +111,125 @@ The abstract syntax tree node.
111
111
| JSONPath Filter Expression | Description |
112
112
| - | - |
113
113
|`$` or `@`| nested JSONPath (returns `true` if any match exists; otherwise, returns `false`) |
114
-
|`=`, `!=`, `>`, `>=`, `<`, `<=`| binary operator, where left-hand operand is a nested JSONPath and right-right operand is a JSON value (returns `true` if any match exists; otherwise, returns `false`) |
114
+
|`=`, `!=`, `>`, `>=`, `<`, `<=`| binary operator, where left-and right-hand operands are nested JSONPaths or JSON values (returns `true` if any match exists; otherwise, returns `false`) |
115
115
|`and`, `or`, `not`| Boolean operator, where operands are JSONPath filter expressions |
116
116
|`(` ... `)`| parentheses |
117
117
118
+
## Functions
119
+
120
+
> See [#14](https://github.com/pacifica/python-jsonpath2/pull/14) for more information.
121
+
122
+
The syntax for a function call is the name of the function followed by the arguments in parentheses, i.e., `name(arg1, arg2, ..., argN)`, where the arguments are either JSONPaths or JSON values.
In the above table, the type aliases (`Any`, `List`, `Optional` and `Tuple`) are defined by the [`typing`](https://docs.python.org/3/library/typing.html) module from the Python Standard Library.
232
+
118
233
## Grammar and parser
119
234
120
235
The [ANTLR v4](https://github.com/antlr/antlr4) grammar for JSONPath is available at `jsonpath2/parser/JSONPath.g4`.
0 commit comments