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
Copy file name to clipboardExpand all lines: README.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,21 +13,23 @@ This implementation passes all compliance tests of [JSONPath Compliance Test Sui
13
13
14
14
## Table of contents
15
15
*[Installation](#installation)
16
-
*[Get values](#get-values)
17
-
*[Get paths](#get-paths)
18
-
*[Set values](#set-values)
19
-
*[Set values and create non-existent paths](#set-values-and-create-non-existent-paths)
20
-
*[Delete paths](#delete-paths)
21
-
*[Custom function extensions](#custom-function-extensions)
16
+
*[Examples](#examples)
17
+
*[Get values](#get-values)
18
+
*[Get paths](#get-paths)
19
+
*[Set values](#set-values)
20
+
*[Set values and create non-existent paths](#set-values-and-create-non-existent-paths)
21
+
*[Delete paths](#delete-paths)
22
+
*[Custom function extensions](#custom-function-extensions)
22
23
23
24
## Installation
24
25
The library can be installed from a command line interface by using [composer](https://getcomposer.org/).
25
26
26
27
```
27
28
composer require ropi/json-path-evaluator
28
29
```
30
+
## Examples
29
31
30
-
## Get values
32
+
###Get values
31
33
The following example shows how to get values that match a JSONPath.\
32
34
The result is always an array of values that match the JSONPath. If there are no matches, an empty array is returned.
33
35
```php
@@ -234,7 +236,7 @@ Get all books where ISBN ends with 1, 2 or 3 (Regular Expression):
234
236
235
237
```
236
238
237
-
## Get paths
239
+
### Get paths
238
240
The following example shows how to get value paths that match a JSONPath, where each value path is represented as normalized JSONPath according to section 2.7 of [JSONPath internet draft](https://datatracker.ietf.org/doc/draft-ietf-jsonpath-base/21/).\
239
241
The result is always an array of matched paths. If there are no matches, an empty array is returned.
240
242
```php
@@ -321,7 +323,7 @@ Get all books cheaper than 10:
321
323
]
322
324
323
325
```
324
-
## Set values
326
+
### Set values
325
327
The following example shows how to set/replace values.
326
328
```php
327
329
<?php
@@ -453,7 +455,7 @@ Set prices alternately to 1, 2 and 3:
453
455
}
454
456
455
457
```
456
-
## Set values and create non-existent paths
458
+
### Set values and create non-existent paths
457
459
The following example shows how to set values on non-existent paths.
458
460
```php
459
461
<?php
@@ -502,7 +504,7 @@ array(1) {
502
504
}
503
505
504
506
```
505
-
## Delete paths
507
+
### Delete paths
506
508
The following example shows how to delete/remove/unset paths that match a JSONPath.
507
509
508
510
```php
@@ -577,7 +579,7 @@ Delete all books that are more expensive than 9 euros:
577
579
}
578
580
579
581
```
580
-
## Custom function extensions
582
+
###Custom function extensions
581
583
The following example shows how to register custom function extensions according to section 2.4 of [JSONPath internet draft](https://datatracker.ietf.org/doc/draft-ietf-jsonpath-base/21/).
0 commit comments