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
@@ -44,31 +44,31 @@ The following functions are exported to support the functionality
44
44
45
45
### Compile
46
46
47
-
Will parse a JSONPath query and return a JSONPath object that can be used to query multiple JSON data objects or strings
47
+
Will parse a JSONPath selector and return a Selector object that can be used to query multiple JSON data objects or strings
48
48
49
49
### Query
50
50
51
-
Will compile a JSONPath query and will query the supplied JSON data in any various formats.
51
+
Will compile a JSONPath selector and will query the supplied JSON data in any various formats.
52
52
53
53
The parser can support querying struct types, and will use the `json` tags for struct fields if they are present, if not it will use the names as they appear in the golang code.
54
54
55
55
### QueryString
56
56
57
-
Will compile a JSONPath query and will query the supplied JSON data.
57
+
Will compile a JSONPath selector and will query the supplied JSON data.
58
58
59
59
QueryString can support a JSON array or object strings, and will unmarshal them to `[]interface{}` or `map[string]interface{}` using the standard `encoding/json` package unmarshal functions.
60
60
61
61
## Types
62
62
63
-
### JSONPath
63
+
### Selector
64
64
65
65
This object is returned by the `Compile` function.
66
66
67
-
The JSONPath struct represents a reusable compiled JSONPath query which supports the `Query`, and `QueryString` functions as detailed above.
67
+
The Selector struct represents a reusable compiled JSONPath selector which supports the `Query`, and `QueryString` functions as detailed above.
68
68
69
69
### Options
70
70
71
-
Part of the JSONPath object, Options allows you to specify what additional functionality, if any, that you want to enable while querying data.
71
+
Part of the Selector object, Options allows you to specify what additional functionality, if any, that you want to enable while querying data.
72
72
73
73
You are able to enable index referencing support for maps for all tokens using `AllowMapReferenceByIndex` or use enable it for each token type individually.
74
74
@@ -95,7 +95,7 @@ You are able to enable index referencing support for strings for all tokens usin
95
95
96
96
represents the data object being queried
97
97
98
-
this should always be the first token in a query. It is also possible to use the root symbol in scripts and filters, for example `$.store.book[?(@.category == $.onSaleCategory)]` would allow you to filter the elements i the book array based on its `category` value compared to the `onSaleCategory` value on the root object.
98
+
this should always be the first token in a selector. It is also possible to use the root symbol in scripts and filters, for example `$.store.book[?(@.category == $.onSaleCategory)]` would allow you to filter the elements i the book array based on its `category` value compared to the `onSaleCategory` value on the root object.
99
99
100
100
### Child
101
101
@@ -190,7 +190,7 @@ If used with a map that has a key `length` it will return the corresponding valu
190
190
191
191
### Subscript, Union, and Range with maps and strings
192
192
193
-
Using the Compile() function, and modifying the JSONPath Options, it is possible to use a map or a string in place of an array with the subscript `[1]` union `[1,2,3]` and range `[0:3]` operations.
193
+
Using the Compile() function, and modifying the Selector Options, it is possible to use a map or a string in place of an array with the subscript `[1]` union `[1,2,3]` and range `[0:3]` operations.
194
194
195
195
For maps, the keys will be sorted into alphabetical order and they will be used to determine the index order. For example, if you had a map with strings `a` and `b`, regardless of the order, `a` would be the `0` index, and `b` the `1` index.
0 commit comments