@@ -18,11 +18,16 @@ queries:
18
18
document : {"a": "first", "2": "second", "b": "third"}
19
19
result : " second"
20
20
status : pass
21
+ - id : array_index_first
22
+ selector : $[0]
23
+ document : ["first", "second", "third", "forth", "fifth"]
24
+ result : " first"
25
+ status : pass
21
26
- id : array_index_last
22
27
selector : $[-1]
23
28
document : ["first", "second", "third"]
24
29
result : " third"
25
- status : open
30
+ status : pass
26
31
- id : array_index_slice_end_out_of_bounds
27
32
selector : $[1:10]
28
33
document : ["first", "second", "third"]
@@ -89,12 +94,14 @@ queries:
89
94
selector : $[0:4:2]
90
95
document : ["first", "second", "third", "forth", "fifth"]
91
96
result : " first"
92
- status : open
97
+ status : fail
98
+ consensus : ["first", "third"]
93
99
- id : array_index_slice_start_equals_end
94
100
selector : $[0:0]
95
101
document : ["first", "second"]
96
102
result : " first"
97
- status : open
103
+ status : fail
104
+ consensus : []
98
105
- id : array_index_slice_start_plus_one
99
106
selector : $[0:1]
100
107
document : ["first", "second"]
@@ -113,6 +120,17 @@ queries:
113
120
result : " first"
114
121
status : fail
115
122
consensus : ["first", "second"]
123
+ - id : filter_current_object_with_value
124
+ selector : $[?(@)]
125
+ document : ["some value", null, "value"]
126
+ result : ["some value", "value"]
127
+ status : open
128
+ - id : filter_equal
129
+ selector : $[?(@.key==42)]
130
+ document : [{"key": 0}, {"key": 42}, {"key": -1}, {"key": 41}, {"key": 43}, {"key": 42.0001}, {"key": 41.9999}, {"key": 100}, {"some": "value"}]
131
+ result : [{"some": "value"}]
132
+ status : fail
133
+ consensus : [{"key": 42}]
116
134
- id : filter_greater_than
117
135
selector : $[?(@.key>42)]
118
136
document : [{"key": 0}, {"key": 42}, {"key": -1}, {"key": 41}, {"key": 43}, {"key": 42.0001}, {"key": 41.9999}, {"key": 100}]
@@ -135,11 +153,31 @@ queries:
135
153
selector : $[?(@.key<=42)]
136
154
document : [{"key": 0}, {"key": 42}, {"key": -1}, {"key": 41}, {"key": 43}, {"key": 42.0001}, {"key": 41.9999}, {"key": 100}, {"some": "value"}]
137
155
status : error
156
+ - id : filter_null
157
+ selector : $[?(@.key==null)]
158
+ document : [{"some": "some value"}, {"key": null}, {"key": "value"}]
159
+ result : [{"some": "some value"}, {"key": null}]
160
+ status : open
161
+ - id : filter_with_boolean_operation
162
+ selector : $[?(@.key>42 && @.key<44)]
163
+ document : [{"key": 42}, {"key": 43}, {"key": 44}]
164
+ result : [{"key": 43}, {"key": 44}]
165
+ status : open
138
166
- id : filter_with_value
139
167
selector : $[?(@.key)]
140
168
document : [{"some": "some value"}, {"key": "value"}]
141
169
result : [{"key": "value"}]
142
170
status : pass
171
+ - id : filter_with_value_on_null
172
+ selector : $[?(@.key)]
173
+ document : [{"some": "some value"}, {"key": null}, {"key": "value"}]
174
+ result : [{"key": "value"}]
175
+ status : open
176
+ - id : filter_without_value
177
+ selector : $[?(!@.key)]
178
+ document : [{"some": "some value"}, {"key": null}, {"key": "value"}]
179
+ result : [{"key": "value"}]
180
+ status : open
143
181
- id : key_bracket_notation
144
182
selector : $['key']
145
183
document : {"key": "value"}
@@ -149,10 +187,34 @@ queries:
149
187
selector : $['key','another']
150
188
document : {"key": "value", "another": "entry"}
151
189
status : error
190
+ - id : key_bracket_notation_union_with_key_on_nested_objects
191
+ selector : $['one','three'].key
192
+ document : {"one": {"key": "value"}, "two": {"k": "v"}, "three": {"some": "more", "key": "other value"}}
193
+ status : error
194
+ - id : key_bracket_notation_with_at_literal
195
+ selector : $['@']
196
+ document : {"@": "value", "another": "entry"}
197
+ status : error
198
+ consensus : " value"
199
+ - id : key_bracket_notation_with_dollar_literal
200
+ selector : $['$']
201
+ document : {"$": "value", "another": "entry"}
202
+ status : error
203
+ consensus : " value"
204
+ - id : key_bracket_notation_with_dot
205
+ selector : $['two.some']
206
+ document : {"one": {"key": "value"}, "two": {"some": "more", "key": "other value"}, "two.some": "42"}
207
+ status : error
208
+ consensus : ["42"]
209
+ - id : key_bracket_notation_with_dot_without_quotes
210
+ selector : $[two.some]
211
+ document : {"one": {"key": "value"}, "two": {"some": "more", "key": "other value"}, "two.some": "42"}
212
+ status : error
152
213
- id : key_bracket_notation_with_double_quotes
153
214
selector : $["key"]
154
215
document : {"key": "value"}
155
216
status : error
217
+ consensus : " value"
156
218
- id : key_bracket_notation_with_number
157
219
selector : $['0']
158
220
document : {"0": "value"}
@@ -177,8 +239,8 @@ queries:
177
239
consensus : " value"
178
240
- id : key_bracket_notation_with_star_literal
179
241
selector : $['*']
180
- document : {"*": "value"}
181
- result : ["value"]
242
+ document : {"*": "value", "another": "entry" }
243
+ result : ["value", "entry" ]
182
244
status : fail
183
245
consensus : " value"
184
246
- id : key_bracket_notation_without_quotes
@@ -189,7 +251,6 @@ queries:
189
251
selector : $.['key']
190
252
document : {"key": "value"}
191
253
status : error
192
- consensus : " value"
193
254
- id : key_dot_bracket_notation_with_double_quotes
194
255
selector : $.["key"]
195
256
document : {"key": "value"}
@@ -230,27 +291,32 @@ queries:
230
291
- id : recursive_key
231
292
selector : $..key
232
293
document : {"object": {"key": "value", "array": [{"key": "something"}, {"key": {"key": "russian dolls"}}]}, "key": "top"}
233
- result : ["top", "value", "something", {"key": "russian dolls"}, "russian dolls"]
294
+ ordered : false
295
+ result : ["russian dolls", "something", "top", "value", {"key": "russian dolls"}]
234
296
status : pass
235
297
- id : recursive_key_with_double_quotes
236
298
selector : $.."key"
237
299
document : {"object": {"key": "value", "array": [{"key": "something"}, {"key": {"key": "russian dolls"}}]}, "key": "top"}
300
+ ordered : false
238
301
result : []
239
302
status : open
240
303
- id : recursive_key_with_single_quotes
241
304
selector : $..'key'
242
305
document : {"object": {"key": "value", "array": [{"key": "something"}, {"key": {"key": "russian dolls"}}]}, "key": "top"}
243
- result : ["top", "value", "something", {"key": "russian dolls"}, "russian dolls"]
306
+ ordered : false
307
+ result : ["russian dolls", "something", "top", "value", {"key": "russian dolls"}]
244
308
status : open
245
309
- id : recursive_on_nested_object
246
310
selector : $.store..price
247
311
document : {"store": {"book": [{"category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95}, {"category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99}, {"category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99}, {"category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99}], "bicycle": {"color": "red", "price": 19.95}}}
248
- result : [8.95, 12.99, 8.99, 22.99, 19.95]
312
+ ordered : false
313
+ result : [12.99, 19.95, 22.99, 8.95, 8.99]
249
314
status : pass
250
315
- id : recursive_wildcard
251
316
selector : $..*
252
317
document : {"key": "value", "another key": {"complex": "string", "primitives": [0, 1]}}
253
- result : ["value", {"complex": "string", "primitives": [0, 1]}, "string", [0, 1], 0, 1]
318
+ ordered : false
319
+ result : ["string", "value", 0, 1, [0, 1], {"complex": "string", "primitives": [0, 1]}]
254
320
status : pass
255
321
- id : recursive_wildcard_on_null_value_array
256
322
selector : $..*
@@ -285,7 +351,8 @@ queries:
285
351
- id : wildcard_bracket_notation_on_object
286
352
selector : $[*]
287
353
document : {"some": "string", "int": 42, "object": {"key": "value"}, "array": [0, 1]}
288
- result : ["string", 42, {"key": "value"}, [0, 1]]
354
+ ordered : false
355
+ result : ["string", 42, [0, 1], {"key": "value"}]
289
356
status : pass
290
357
- id : wildcard_bracket_notation_with_key_on_nested_objects
291
358
selector : $[*].bar[*].baz
@@ -300,5 +367,6 @@ queries:
300
367
- id : wildcard_dot_notation_on_object
301
368
selector : $.*
302
369
document : {"some": "string", "int": 42, "object": {"key": "value"}, "array": [0, 1]}
303
- result : ["string", 42, {"key": "value"}, [0, 1]]
370
+ ordered : false
371
+ result : ["string", 42, [0, 1], {"key": "value"}]
304
372
status : pass
0 commit comments