8000 Update the README.md to explain new backquote operators · cdent/python-jsonpath-rw@0a92ebd · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 0a92ebd

Browse files
committed
Update the README.md to explain new backquote operators
1 parent d9d2a09 commit 0a92ebd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Atomic expressions:
2828
Syntax | Meaning
2929
------------------------------|-------------------
3030
`$` | The root object
31+
`` `this` `` | The "current" object.
32+
`` `foo` `` | More generally, this syntax allows "named operators" to extend JSONPath is arbitrary ways
3133
_field_ | Specified field(s), described below
3234
`[` _field_ `]` | Same as _field_
3335
`[` _idx_ `]` | Array access, described below (this is always unambiguous with field access)
@@ -58,9 +60,9 @@ Array specifiers ( _idx_ ):
5860

5961
Syntax | Meaning
6062
---------------------------------------|----------------------------------------
61-
- `[`_n_`]` | array index (may be comma-separated list)
62-
- `[`_start_`?:`_end_`?]` | array slicing (note that _step_ is unimplemented only due to lack of need thus far)
63-
- `[*]` | any array index
63+
`[`_n_`]` | array index (may be comma-separated list)
64+
`[`_start_`?:`_end_`?]` | array slicing (note that _step_ is unimplemented only due to lack of need thus far)
65+
`[*]` | any array index
6466

6567

6668
Programmatic JSONPath
@@ -89,6 +91,9 @@ Extensions
8991
None, then for any piece of data missing that field, it will be replaced by
9092
the JSONPath to it, giving automatic unique ids to any piece of data. These ids will
9193
take into account any ids already present as well.
94+
- _Named operators_: Instead of using `@` to reference the currently object, this library
95+
uses `` `this` ``. In general, any string contained in backquotes can be made to be
96+
a new operator, currently by extending the library.
9297

9398

9499
More to explore

0 commit comments

Comments
 (0)
0