-
-
Notifications
You must be signed in to change notification settings - Fork 27
Queries
Below, you will find a list of queries, which are currently supported by this library. This list has been created, based on the great comparison list project by Christoph Burgmer.
Other queries might be supported too, but there's no consensus (aka expected result), therefore it is unclear if the results returned are correct, or not. A list of possibly supported queries can be found here.
Corresponding unit/functional tests for these specific queries can be found here.
Array Slice
- Array Slice
- Array Slice On Exact Match
- Array Slice On Non Overlapping Array
- Array Slice On Object
- Array Slice On Partially Overlapping Array
- Array Slice With Negative Start And End And Range Of -1
- Array Slice With Negative Start And End And Range Of 0
- Array Slice With Negative Start And End And Range Of 1
- Array Slice With Negative Start And Positive End And Range Of -1
- Array Slice With Negative Start And Positive End And Range Of 0
- Array Slice With Negative Start And Positive End And Range Of 1
- Array Slice With Open End
- Array Slice With Open Start
- Array Slice With Open Start And End
- Array Slice With Open Start And End And Step Empty
- Array Slice With Positive Start And Negative End And Range Of -1
- Array Slice With Positive Start And Negative End And Range Of 0
- Array Slice With Positive Start And Negative End And Range Of 1
- Array Slice With Range Of -1
- Array Slice With Range Of 0
- Array Slice With Range Of 1
- Array Slice With Start -1 And Open End
- Array Slice With Start -2 And Open End
- Array Slice With Start Large Negative Number And Open End On Short Array
- Array Slice With Step
- Array Slice With Step 1
- Array Slice With Step And Leading Zeros
- Array Slice With Step But End Not Aligned
- Array Slice With Step Empty
- Array Slice With Step Only
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[1:3]
Consensus:
[
"second",
"third"
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0:5]
Consensus:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[7:10]
Consensus:
[]
Test Data:
{
":": 42,
"more": "string",
"a": 1,
"b": 2,
"c": 3,
"1:3": "nice"
}
Selector:
$[1:3]
Consensus:
[]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[1:10]
Consensus:
[
"second",
"third"
]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[-4:-5]
Consensus:
[]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[-4:-4]
Consensus:
[]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[-4:-3]
Consensus:
[
4
]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[-4:1]
Consensus:
[]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[-4:2]
Consensus:
[]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[-4:3]
Consensus:
[
4
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[1:]
Consensus:
[
"second",
"third",
"forth",
"fifth"
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[:2]
Consensus:
[
"first",
"second"
]
Test Data:
[
"first",
"second"
]
Selector:
$[:]
Consensus:
[
"first",
"second"
]
Test Data:
[
"first",
"second"
]
Selector:
$[::]
Consensus:
[
"first",
"second"
]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[3:-4]
Consensus:
[]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[3:-3]
Consensus:
[]
Test Data:
[
2,
"a",
4,
5,
100,
"nice"
]
Selector:
$[3:-2]
Consensus:
[
5
]
Test Data:
[
"first",
"second",
"third",
"forth"
]
Selector:
$[2:1]
Consensus:
[]
Test Data:
[
"first",
"second"
]
Selector:
$[0:0]
Consensus:
[]
Test Data:
[
"first",
"second"
]
Selector:
$[0:1]
Consensus:
[
"first"
]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[-1:]
Consensus:
[
"third"
]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[-2:]
Consensus:
[
"second",
"third"
]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[-4:]
Consensus:
[
"first",
"second",
"third"
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0:3:2]
Consensus:
[
"first",
"third"
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0:3:1]
Consensus:
[
"first",
"second",
"third"
]
Test Data:
[
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
Selector:
$[010:024:010]
Consensus:
[
10,
20
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0:4:2]
Consensus:
[
"first",
"third"
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[1:3:]
Consensus:
[
"second",
"third"
]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[::2]
Consensus:
[
"first",
"third",
"fifth"
]
Bracket Notation
- Bracket Notation
- Bracket Notation After Recursive Descent
- Bracket Notation On Object Without Key
- Bracket Notation With NFC Path On NFD Key
- Bracket Notation With Dot
- Bracket Notation With Double Quotes
- Bracket Notation With Empty String
- Bracket Notation With Empty String Doubled Quoted
- Bracket Notation With Negative Number On Short Array
- Bracket Notation With Number
- Bracket Notation With Number -1
- Bracket Notation With Number -1 On Empty Array
- Bracket Notation With Number 0
- Bracket Notation With Number After Dot Notation With Wildcard On Nested Arrays With Different Length
- Bracket Notation With Number On Short Array
- Bracket Notation With Quoted Array Slice Literal
- Bracket Notation With Quoted Closing Bracket Literal
- Bracket Notation With Quoted Current Object Literal
- Bracket Notation With Quoted Dot Literal
- Bracket Notation With Quoted Dot Wildcard
- Bracket Notation With Quoted Double Quote Literal
- Bracket Notation With Quoted Number On Object
- Bracket Notation With Quoted Root Literal
- Bracket Notation With Quoted Union Literal
- Bracket Notation With Quoted Wildcard Literal
- Bracket Notation With String Including Dot Wildcard
- Bracket Notation With Wildcard After Array Slice
- Bracket Notation With Wildcard After Dot Notation After Bracket Notation With Wildcard
- Bracket Notation With Wildcard After Recursive Descent
- Bracket Notation With Wildcard On Array
- Bracket Notation With Wildcard On Empty Array
- Bracket Notation With Wildcard On Empty Object
- Bracket Notation With Wildcard On Null Value Array
- Bracket Notation With Wildcard On Object
Test Data:
{
"key": "value"
}
Selector:
$['key']
Consensus:
[
"value"
]
Test Data:
[
"first",
{
"key": [
"first nested",
{
"more": [
{
"nested": [
"deepest",
"second"
]
},
[
"more",
"values"
]
]
}
]
}
]
Selector:
$..[0]
Consensus:
[
"deepest",
"first nested",
"first",
"more",
{
"nested": [
"deepest",
"second"
]
}
]
Test Data:
{
"key": "value"
}
Selector:
$['missing']
Consensus:
[]
Test Data:
{
"u\u0308": 42
}
Selector:
$['ü']
Consensus:
[]
Test Data:
{
"one": {
"key": "value"
},
"two": {
"some": "more",
"key": "other value"
},
"two.some": "42"
}
Selector:
$['two.some']
Consensus:
[
"42"
]
Test Data:
{
"key": "value"
}
Selector:
$["key"]
Consensus:
[
"value"
]
Test Data:
{
"": 42,
"''": 123,
"\"\"": 222
}
Selector:
$['']
Consensus:
[
42
]
Test Data:
{
"": 42,
"''": 123,
"\"\"": 222
}
Selector:
$[""]
Consensus:
[
42
]
Test Data:
[
"one element"
]
Selector:
$[-2]
Consensus:
[]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[2]
Consensus:
[
"third"
]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[-1]
Consensus:
[
"third"
]
Test Data:
[]
Selector:
$[-1]
Consensus:
[]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0]
Consensus:
[
"first"
]
Bracket Notation With Number After Dot Notation With Wildcard On Nested Arrays With Different Length
Test Data:
[
[
1
],
[
2,
3
]
]
Selector:
$.*[1]
Consensus:
[
3
]
Test Data:
[
"one element"
]
Selector:
$[1]
Consensus:
[]
Test Data:
{
":": "value",
"another": "entry"
}
Selector:
$[':']
Consensus:
[
"value"
]
Test Data:
{
"]": 42
}
Selector:
$[']']
Consensus:
[
42
]
Test Data:
{
"@": "value",
"another": "entry"
}
Selector:
$['@']
Consensus:
[
"value"
]
Test Data:
{
".": "value",
"another": "entry"
}
Selector:
$['.']
Consensus:
[
"value"
]
Test Data:
{
"key": 42,
".*": 1,
"": 10
}
Selector:
$['.*']
Consensus:
[
1
]
Test Data:
{
"\"": "value",
"another": "entry"
}
Selector:
$['"']
Consensus:
[
"value"
]
Test Data:
{
"0": "value"
}
Selector:
$['0']
Consensus:
[
"value"
]
Test Data:
{
"$": "value",
"another": "entry"
}
Selector:
$['$']
Consensus:
[
"value"
]
Test Data:
{
",": "value",
"another": "entry"
}
Selector:
$[',']
Consensus:
[
"value"
]
Test Data:
{
"*": "value",
"another": "entry"
}
Selector:
$['*']
Consensus:
[
"value"
]
Test Data:
{
"nice": 42,
"ni.*": 1,
"mice": 100
}
Selector:
$['ni.*']
Consensus:
[
1
]
Test Data:
[
[
1,
2
],
[
"a",
"b"
],
[
0,
0
]
]
Selector:
$[0:2][*]
Consensus:
[
1,
2,
"a",
"b"
]
Test Data:
[
{
"bar": [
42
]
}
]
Selector:
$[*].bar[*]
Consensus:
[
42
]
Test Data:
{
"key": "value",
"another key": {
"complex": "string",
"primitives": [
0,
1
]
}
}
Selector:
$..[*]
Consensus:
[
"string",
"value",
0,
1,
[
0,
1
],
{
"complex": "string",
"primitives": [
0,
1
]
}
]
Test Data:
[
"string",
42,
{
"key": "value"
},
[
0,
1
]
]
Selector:
$[*]
Consensus:
[
"string",
42,
{
"key": "value"
},
[
0,
1
]
]
Test Data:
[]
Selector:
$[*]
Consensus:
[]
Test Data:
{}
Selector:
$[*]
Consensus:
[]
Test Data:
[
40,
null,
42
]
Selector:
$[*]
Consensus:
[
40,
null,
42
]
Test Data:
{
"some": "string",
"int": 42,
"object": {
"key": "value"
},
"array": [
0,
1
]
}
Selector:
$[*]
Consensus:
[
"string",
42,
[
0,
1
],
{
"key": "value"
}
]
Dot Notation
- Dot Notation
- Dot Notation After Array Slice
- Dot Notation After Bracket Notation After Recursive Descent
- Dot Notation After Bracket Notation With Wildcard
- Dot Notation After Bracket Notation With Wildcard On One Matching
- Dot Notation After Bracket Notation With Wildcard On Some Matching
- Dot Notation After Filter Expression
- Dot Notation After Recursive Descent
- Dot Notation After Recursive Descent After Dot Notation
- Dot Notation After Union
- Dot Notation After Union With Keys
- Dot Notation On Array
- Dot Notation On Array Value
- Dot Notation On Array With Containing Object Matching Key
- Dot Notation On Empty Object Value
- Dot Notation On Null Value
- Dot Notation On Object Without Key
- Dot Notation With Dash
- Dot Notation With Key Named In
- Dot Notation With Key Named Length
- Dot Notation With Key Named Length On Array
- Dot Notation With Key Named Null
- Dot Notation With Key Named True
- Dot Notation With Non ASCII Key
- Dot Notation With Number On Object
- Dot Notation With Wildcard After Dot Notation After Dot Notation With Wildcard
- Dot Notation With Wildcard After Dot Notation With Wildcard On Nested Arrays
- Dot Notation With Wildcard After Recursive Descent
- Dot Notation With Wildcard After Recursive Descent On Null Value Array
- Dot Notation With Wildcard After Recursive Descent On Scalar
- Dot Notation With Wildcard On Array
- Dot Notation With Wildcard On Empty Array
- Dot Notation With Wildcard On Empty Object
- Dot Notation With Wildcard On Object
Test Data:
{
"key": "value"
}
Selector:
$.key
Consensus:
[
"value"
]
Test Data:
[
{
"key": "ey"
},
{
"key": "bee"
},
{
"key": "see"
}
]
Selector:
$[0:2].key
Consensus:
[
"ey",
"bee"
]
Test Data:
{
"k": [
{
"key": "some value"
},
{
"key": 42
}
],
"kk": [
[
{
"key": 100
},
{
"key": 200
},
{
"key": 300
}
],
[
{
"key": 400
},
{
"key": 500
},
{
"key": 600
}
]
],
"key": [
0,
1
]
}
Selector:
$..[1].key
Consensus:
[
200,
42,
500
]
Test Data:
[
{
"a": 1
},
{
"a": 1
}
]
Selector:
$[*].a
Consensus:
[
1,
1
]
Test Data:
[
{
"a": 1
}
]
Selector:
$[*].a
Consensus:
[
1
]
Test Data:
[
{
"a": 1
},
{
"b": 1
}
]
Selector:
$[*].a
Consensus:
[
1
]
Test Data:
[
{
"id": 42,
"name": "forty-two"
},
{
"id": 1,
"name": "one"
}
]
Selector:
$[?(@.id==42)].name
Consensus:
[
"forty-two"
]
Test Data:
{
"object": {
"key": "value",
"array": [
{
"key": "something"
},
{
"key": {
"key": "russian dolls"
}
}
]
},
"key": "top"
}
Selector:
$..key
Consensus:
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Test Data:
{
"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
}
}
}
Selector:
$.store..price
Consensus:
[
12.99,
19.95,
22.99,
8.95,
8.99
]
Test Data:
[
{
"key": "ey"
},
{
"key": "bee"
},
{
"key": "see"
}
]
Selector:
$[0,2].key
Consensus:
[
"ey",
"see"
]
Test Data:
{
"one": {
"key": "value"
},
"two": {
"k": "v"
},
"three": {
"some": "more",
"key": "other value"
}
}
Selector:
$['one','three'].key
Consensus:
[
"value",
"other value"
]
Test Data:
[
0,
1
]
Selector:
$.key
Consensus:
[]
Test Data:
{
"key": [
"first",
"second"
]
}
Selector:
$.key
Consensus:
[
[
"first",
"second"
]
]
Test Data:
[
{
"id": 2
}
]
Selector:
$.id
Consensus:
[]
Test Data:
{
"key": {}
}
Selector:
$.key
Consensus:
[
{}
]
Test Data:
{
"key": null
}
Selector:
$.key
Consensus:
[
null
]
Test Data:
{
"key": "value"
}
Selector:
$.missing
Consensus:
[]
Test Data:
{
"key-dash": "value"
}
Selector:
$.key-dash
Consensus:
[
"value"
]
Test Data:
{
"in": "value"
}
Selector:
$.in
Consensus:
[
"value"
]
Test Data:
{
"length": "value"
}
Selector:
$.length
Consensus:
[
"value"
]
Test Data:
[
4,
5,
6
]
Selector:
$.length
Consensus:
[]
Test Data:
{
"null": "value"
}
Selector:
$.null
Consensus:
[
"value"
]
Test Data:
{
"true": "value"
}
Selector:
$.true
Consensus:
[
"value"
]
Test Data:
{
"\u5c6c\u6027": "value"
}
Selector:
$.屬性
Consensus:
[
"value"
]
Test Data:
{
"a": "first",
"2": "second",
"b": "third"
}
Selector:
$.2
Consensus:
[
"second"
]
Test Data:
[
{
"bar": [
42
]
}
]
Selector:
$.*.bar.*
Consensus:
[
42
]
Test Data:
[
[
1,
2,
3
],
[
4,
5,
6
]
]
Selector:
$.*.*
Consensus:
[
1,
2,
3,
4,
5,
6
]
Test Data:
{
"key": "value",
"another key": {
"complex": "string",
"primitives": [
0,
1
]
}
}
Selector:
$..*
Consensus:
[
"string",
"value",
0,
1,
[
0,
1
],
{
"complex": "string",
"primitives": [
0,
1
]
}
]
Test Data:
[
40,
null,
42
]
Selector:
$..*
Consensus:
[
40,
42,
null
]
Test Data:
42
Selector:
$..*
Consensus:
[]
Test Data:
[
"string",
42,
{
"key": "value"
},
[
0,
1
]
]
Selector:
$.*
Consensus:
[
"string",
42,
{
"key": "value"
},
[
0,
1
]
]
Test Data:
[]
Selector:
$.*
Consensus:
[]
Test Data:
{}
Selector:
$.*
Consensus:
[]
Test Data:
{
"some": "string",
"int": 42,
"object": {
"key": "value"
},
"array": [
0,
1
]
}
Selector:
$.*
Consensus:
[
"string",
42,
[
0,
1
],
{
"key": "value"
}
]
Filter Expression
- Filter Expression With Bracket Notation
- Filter Expression With Bracket Notation And Current Object Literal
- Filter Expression With Bracket Notation With Number
- Filter Expression With Equals On Array Without Match
- Filter Expression With Equals String With Current Object Literal
- Filter Expression With Equals String With Dot Literal
- Filter Expression With Equals String With Single Quotes
- Filter Expression With Subpaths
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"some": "value"
}
]
Selector:
$[?(@['key']==42)]
Consensus:
[
{
"key": 42
}
]
Test Data:
[
{
"@key": 0
},
{
"@key": 42
},
{
"key": 42
},
{
"@key": 43
},
{
"some": "value"
}
]
Selector:
$[?(@['@key']==42)]
Consensus:
[
{
"@key": 42
}
]
Test Data:
[
[
"a",
"b"
],
[
"x",
"y"
]
]
Selector:
$[?(@[1]=='b')]
Consensus:
[
[
"a",
"b"
]
]
Test Data:
[
{
"key": 42
}
]
Selector:
$[?(@.key==43)]
Consensus:
[]
Test Data:
[
{
"key": "some"
},
{
"key": "value"
},
{
"key": "[email protected]"
}
]
Selector:
$[?(@.key=="[email protected]")]
Consensus:
[
{
"key": "[email protected]"
}
]
Test Data:
[
{
"key": "some"
},
{
"key": "value"
},
{
"key": "some.value"
}
]
Selector:
$[?(@.key=="some.value")]
Consensus:
[
{
"key": "some.value"
}
]
Test Data:
[
{
"key": "some"
},
{
"key": "value"
}
]
Selector:
$[?(@.key=='value')]
Consensus:
[
{
"key": "value"
}
]
Test Data:
[
{
"address": {
"city": "Berlin"
}
},
{
"address": {
"city": "London"
}
}
]
Selector:
$[?(@.address.city=='Berlin')]
Consensus:
[
{
"address": {
"city": "Berlin"
}
}
]
Root
Test Data:
{
"key": "value",
"another key": {
"complex": [
"a",
1
]
}
}
Selector:
$
Consensus:
[
{
"another key": {
"complex": [
"a",
1
]
},
"key": "value"
}
]
Test Data:
42
Selector:
$
Consensus:
[
42
]
Test Data:
false
Selector:
$
Consensus:
[
false
]
Test Data:
true
Selector:
$
Consensus:
[
true
]
Union
- Union
- Union With Keys
- Union With Keys After Array Slice
- Union With Keys After Bracket Notation
- Union With Keys On Object Without Key
- Union With Numbers In Decreasing Order
- Union With Spaces
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[0,1]
Consensus:
[
"first",
"second"
]
Test Data:
{
"key": "value",
"another": "entry"
}
Selector:
$['key','another']
Consensus:
[
"value",
"entry"
]
Test Data:
[
{
"c": "cc1",
"d": "dd1",
"e": "ee1"
},
{
"c": "cc2",
"d": "dd2",
"e": "ee2"
}
]
Selector:
$[:]['c','d']
Consensus:
[
"cc1",
"dd1",
"cc2",
"dd2"
]
Test Data:
[
{
"c": "cc1",
"d": "dd1",
"e": "ee1"
},
{
"c": "cc2",
"d": "dd2",
"e": "ee2"
}
]
Selector:
$[0]['c','d']
Consensus:
[
"cc1",
"dd1"
]
Test Data:
{
"key": "value",
"another": "entry"
}
Selector:
$['missing','key']
Consensus:
[
"value"
]
Test Data:
[
1,
2,
3,
4,
5
]
Selector:
$[4,1]
Consensus:
[
5,
2
]
Test Data:
[
"first",
"second",
"third"
]
Selector:
$[ 0 , 1 ]
Consensus:
[
"first",
"second"
]
Below, you will find a list of queries, which are possibly supported by this library. Possibly means, that there's no consensus (aka expected result), therefore it is unclear if the results returned are correct, or not.
Array Slice
- Array Slice With Large Number For End And Negative Step
- Array Slice With Large Number For Start End Negative Step
- Array Slice With Negative Step
- Array Slice With Negative Step On Partially Overlapping Array
- Array Slice With Open Start And End On Object
- Array Slice With Step 0
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[2:-113667776004:-1]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[113667776004:2:-1]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[3:0:-2]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[7:3:-1]
Test Data:
{
":": 42,
"more": "string"
}
Selector:
$[:]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0:3:0]
Bracket Notation
- Bracket Notation With Empty Path
- Bracket Notation With Number On Object
- Bracket Notation With Number On String
- Bracket Notation With Quoted Escaped Backslash
- Bracket Notation With Quoted Escaped Single Quote
- Bracket Notation With Quoted Special Characters Combined
- Bracket Notation With Quoted String And Unescaped Single Quote
- Bracket Notation With Quoted Wildcard Literal On Object Without Key
- Bracket Notation With Two Literals Separated By Dot
- Bracket Notation With Two Literals Separated By Dot Without Quotes
- Bracket Notation Without Quotes
- Dot Bracket Notation
- Dot Bracket Notation With Double Quotes
- Dot Bracket Notation Without Quotes
- Dot Notation With Double Quotes
- Dot Notation With Double Quotes After Recursive Descent
- Dot Notation With Empty Path
- Dot Notation With Key Root Literal
- Dot Notation With Number
- Dot Notation With Number -1
- Dot Notation With Single Quotes
- Dot Notation With Single Quotes After Recursive Descent
- Dot Notation With Single Quotes And Dot
- Dot Notation Without Root
Test Data:
{
"": 42,
"''": 123,
"\"\"": 222
}
Selector:
$[]
Test Data:
{
"0": "value"
}
Selector:
$[0]
Test Data:
"Hello World"
Selector:
$[0]
Test Data:
{
"\\": "value"
}
Selector:
$['\\']
Test Data:
{
"'": "value"
}
Selector:
$['\'']
Test Data:
{
":@.\"$,*'\\": 42
}
Selector:
$[':@."$,*\'\\']
Test Data:
{
"single'quote": "value"
}
Selector:
$['single'quote']
Test Data:
{
"another": "entry"
}
Selector:
$['*']
Test Data:
{
"one": {
"key": "value"
},
"two": {
"some": "more",
"key": "other value"
},
"two.some": "42",
"two'.'some": "43"
}
Selector:
$['two'.'some']
Test Data:
{
"one": {
"key": "value"
},
"two": {
"some": "more",
"key": "other value"
},
"two.some": "42"
}
Selector:
$[two.some]
Test Data:
{
"key": "value"
}
Selector:
$[key]
Test Data:
{
"key": "value",
"other": {
"key": [
{
"key": 42
}
]
}
}
Selector:
$.['key']
Test Data:
{
"key": "value",
"other": {
"key": [
{
"key": 42
}
]
}
}
Selector:
$.["key"]
Test Data:
{
"key": "value",
"other": {
"key": [
{
"key": 42
}
]
}
}
Selector:
$.[key]
Test Data:
{
"key": "value",
"\"key\"": 42
}
Selector:
$."key"
Test Data:
{
"object": {
"key": "value",
"\"key\"": 100,
"array": [
{
"key": "something",
"\"key\"": 0
},
{
"key": {
"key": "russian dolls"
},
"\"key\"": {
"\"key\"": 99
}
}
]
},
"key": "top",
"\"key\"": 42
}
Selector:
$.."key"
Test Data:
{
"key": 42,
"": 9001,
"''": "nice"
}
Selector:
$.
Test Data:
{
"$": "value"
}
Selector:
$.$
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$.2
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$.-1
Test Data:
{
"key": "value",
"'key'": 42
}
Selector:
$.'key'
Test Data:
{
"object": {
"key": "value",
"'key'": 100,
"array": [
{
"key": "something",
"'key'": 0
},
{
"key": {
"key": "russian dolls"
},
"'key'": {
"'key'": 99
}
}
]
},
"key": "top",
"'key'": 42
}
Selector:
$..'key'
Test Data:
{
"some.key": 42,
"some": {
"key": "value"
},
"'some.key'": 43
}
Selector:
$.'some.key'
Test Data:
{
"key": "value"
}
Selector:
key
Filter Expression
- Filter Expression After Dot Notation With Wildcard After Recursive Descent
- Filter Expression After Recursive Descent
- Filter Expression On Object
- Filter Expression With Addition
- Filter Expression With Boolean And Operator
- Filter Expression With Boolean And Operator And Value False
- Filter Expression With Boolean And Operator And Value True
- Filter Expression With Boolean Or Operator
- Filter Expression With Boolean Or Operator And Value False
- Filter Expression With Boolean Or Operator And Value True
- Filter Expression With Bracket Notation With -1
- Filter Expression With Bracket Notation With Number On Object
- Filter Expression With Current Object
- Filter Expression With Different Grouped Operators
- Filter Expression With Different Ungrouped Operators
- Filter Expression With Division
- Filter Expression With Empty Expression
- Filter Expression With Equals
- Filter Expression With Equals Array
- Filter Expression With Equals Array For Array Slice With Range 1
- Filter Expression With Equals Array For Dot Notation With Star
- Filter Expression With Equals Array With Single Quotes
- Filter Expression With Equals Boolean Expression Value
- Filter Expression With Equals False
- Filter Expression With Equals Null
- Filter Expression With Equals Number For Array Slice With Range 1
- Filter Expression With Equals Number For Bracket Notation With Star
- Filter Expression With Equals Number For Dot Notation With Star
- Filter Expression With Equals Number With Fraction
- Filter Expression With Equals Number With Leading Zeros
- Filter Expression With Equals Object
- Filter Expression With Equals On Array Of Numbers
- Filter Expression With Equals On Object
- Filter Expression With Equals On Object With Key Matching Query
- Filter Expression With Equals String
- Filter Expression With Equals True
- Filter Expression With Equals With Root Reference
- Filter Expression With Greater Than
- Filter Expression With Greater Than Or Equal
- Filter Expression With In Array Of Values
- Filter Expression With In Current Object
- Filter Expression With Less Than
- Filter Expression With Less Than Or Equal
- Filter Expression With Multiplication
- Filter Expression With Negation And Equals
- Filter Expression With Negation And Less Than
- Filter Expression With Not Equals
- Filter Expression With Regular Expression
- Filter Expression With Set Wise Comparison To Scalar
- Filter Expression With Set Wise Comparison To Set
- Filter Expression With Single Equal
- Filter Expression With Subfilter
- Filter Expression With Subtraction
- Filter Expression With Tautological Comparison
- Filter Expression With Triple Equal
- Filter Expression With Value
- Filter Expression With Value After Dot Notation With Wildcard On Array Of Objects
- Filter Expression With Value After Recursive Descent
- Filter Expression With Value False
- Filter Expression With Value From Recursive Descent
- Filter Expression With Value Null
- Filter Expression With Value True
- Filter Expression Without Parens
- Filter Expression Without Value
Test Data:
[
{
"complext": {
"one": [
{
"name": "first",
"id": 1
},
{
"name": "next",
"id": 2
},
{
"name": "another",
"id": 3
},
{
"name": "more",
"id": 4
}
],
"more": {
"name": "next to last",
"id": 5
}
}
},
{
"name": "last",
"id": 6
}
]
Selector:
$..*[?(@.id>2)]
Test Data:
{
"id": 2,
"more": [
{
"id": 2
},
{
"more": {
"id": 2
}
},
{
"id": {
"id": 2
}
},
[
{
"id": 2
}
]
]
}
Selector:
$..[?(@.id==2)]
Test Data:
{
"key": 42,
"another": {
"key": 1
}
}
Selector:
$[?(@.key)]
Test Data:
[
{
"key": 60
},
{
"key": 50
},
{
"key": 10
},
{
"key": -50
},
{
"key+50": 100
}
]
Selector:
$[?(@.key+50==100)]
Test Data:
[
{
"key": 42
},
{
"key": 43
},
{
"key": 44
}
]
Selector:
$[?(@.key>42 && @.key<44)]
Test Data:
[
{
"key": 1
},
{
"key": 3
},
{
"key": "nice"
},
{
"key": true
},
{
"key": null
},
{
"key": false
},
{
"key": {}
},
{
"key": []
},
{
"key": -1
},
{
"key": 0
},
{
"key": ""
}
]
Selector:
$[?(@.key>0 && false)]
Test Data:
[
{
"key": 1
},
{
"key": 3
},
{
"key": "nice"
},
{
"key": true
},
{
"key": null
},
{
"key": false
},
{
"key": {}
},
{
"key": []
},
{
"key": -1
},
{
"key": 0
},
{
"key": ""
}
]
Selector:
$[?(@.key>0 && true)]
Test Data:
[
{
"key": 42
},
{
"key": 43
},
{
"key": 44
}
]
Selector:
$[?(@.key>43 || @.key<43)]
Test Data:
[
{
"key": 1
},
{
"key": 3
},
{
"key": "nice"
},
{
"key": true
},
{
"key": null
},
{
"key": false
},
{
"key": {}
},
{
"key": []
},
{
"key": -1
},
{
"key": 0
},
{
"key": ""
}
]
Selector:
$[?(@.key>0 || false)]
Test Data:
[
{
"key": 1
},
{
"key": 3
},
{
"key": "nice"
},
{
"key": true
},
{
"key": null
},
{
"key": false
},
{
"key": {}
},
{
"key": []
},
{
"key": -1
},
{
"key": 0
},
{
"key": ""
}
]
Selector:
$[?(@.key>0 || true)]
Test Data:
[
[
2,
3
],
[
"a"
],
[
0,
2
],
[
2
]
]
Selector:
$[?(@[-1]==2)]
Test Data:
{
"1": [
"a",
"b"
],
"2": [
"x",
"y"
]
}
Selector:
$[?(@[1]=='b')]
Test Data:
[
"some value",
null,
"value",
0,
1,
-1,
"",
[],
{},
false,
true
]
Selector:
$[?(@)]
Test Data:
[
{
"a": true
},
{
"a": true,
"b": true
},
{
"a": true,
"b": true,
"c": true
},
{
"b": true,
"c": true
},
{
"a": true,
"c": true
},
{
"c": true
},
{
"b": true
}
]
Selector:
$[?(@.a && (@.b || @.c))]
Test Data:
[
{
"a": true,
"b": true
},
{
"a": true,
"b": true,
"c": true
},
{
"b": true,
"c": true
},
{
"a": true,
"c": true
},
{
"a": true
},
{
"b": true
},
{
"c": true
},
{
"d": true
},
{}
]
Selector:
$[?(@.a && @.b || @.c)]
Test Data:
[
{
"key": 60
},
{
"key": 50
},
{
"key": 10
},
{
"key": -50
},
{
"key\/10": 5
}
]
Selector:
$[?(@.key/10==5)]
Test Data:
[
1,
{
"key": 42
},
"value",
null
]
Selector:
$[?()]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "some"
},
{
"key": "42"
},
{
"key": null
},
{
"key": 420
},
{
"key": ""
},
{
"key": {}
},
{
"key": []
},
{
"key": [
42
]
},
{
"key": {
"key": 42
}
},
{
"key": {
"some": 42
}
},
{
"some": "value"
}
]
Selector:
$[?(@.key==42)]
Test Data:
[
{
"d": [
"v1",
"v2"
]
},
{
"d": [
"a",
"b"
]
},
{
"d": "v1"
},
{
"d": "v2"
},
{
"d": {}
},
{
"d": []
},
{
"d": null
},
{
"d": -1
},
{
"d": 0
},
{
"d": 1
},
{
"d": "['v1','v2']"
},
{
"d": "['v1', 'v2']"
},
{
"d": "v1,v2"
},
{
"d": "[\"v1\", \"v2\"]"
},
{
"d": "[\"v1\",\"v2\"]"
}
]
Selector:
$[?(@.d==["v1","v2"])]
Test Data:
[
[
1,
2,
3
],
[
1
],
[
2,
3
],
1,
2
]
Selector:
$[?(@[0:1]==[1])]
Test Data:
[
[
1,
2
],
[
2,
3
],
[
1
],
[
2
],
[
1,
2,
3
],
1,
2,
3
]
Selector:
$[?(@.*==[1,2])]
Test Data:
[
{
"d": [
"v1",
"v2"
]
},
{
"d": [
"a",
"b"
]
},
{
"d": "v1"
},
{
"d": "v2"
},
{
"d": {}
},
{
"d": []
},
{
"d": null
},
{
"d": -1
},
{
"d": 0
},
{
"d": 1
},
{
"d": "['v1','v2']"
},
{
"d": "['v1', 'v2']"
},
{
"d": "v1,v2"
},
{
"d": "[\"v1\", \"v2\"]"
},
{
"d": "[\"v1\",\"v2\"]"
}
]
Selector:
$[?(@.d==['v1','v2'])]
Test Data:
[
{
"key": 42
},
{
"key": 43
},
{
"key": 44
}
]
Selector:
$[?((@.key<44)==false)]
Test Data:
[
{
"some": "some value"
},
{
"key": true
},
{
"key": false
},
{
"key": null
},
{
"key": "value"
},
{
"key": ""
},
{
"key": 0
},
{
"key": 1
},
{
"key": -1
},
{
"key": 42
},
{
"key": {}
},
{
"key": []
}
]
Selector:
$[?(@.key==false)]
Test Data:
[
{
"some": "some value"
},
{
"key": true
},
{
"key": false
},
{
"key": null
},
{
"key": "value"
},
{
"key": ""
},
{
"key": 0
},
{
"key": 1
},
{
"key": -1
},
{
"key": 42
},
{
"key": {}
},
{
"key": []
}
]
Selector:
$[?(@.key==null)]
Test Data:
[
[
1,
2,
3
],
[
1
],
[
2,
3
],
1,
2
]
Selector:
$[?(@[0:1]==1)]
Test Data:
[
[
1,
2
],
[
2,
3
],
[
1
],
[
2
],
[
1,
2,
3
],
1,
2,
3
]
Selector:
$[?(@[*]==2)]
Test Data:
[
[
1,
2
],
[
2,
3
],
[
1
],
[
2
],
[
1,
2,
3
],
1,
2,
3
]
Selector:
$[?(@.*==2)]
Test Data:
[
{
"key": -12.3
},
{
"key": -0.123
},
{
"key": -12
},
{
"key": 12.3
},
{
"key": 2
},
{
"key": "-0.123e2"
}
]
Selector:
$[?(@.key==-0.123e2)]
Test Data:
[
{
"key": "010"
},
{
"key": "10"
},
{
"key": 10
},
{
"key": 0
},
{
"key": 8
}
]
Selector:
$[?(@.key==010)]
Test Data:
[
{
"d": {
"k": "v"
}
},
{
"d": {
"a": "b"
}
},
{
"d": "k"
},
{
"d": "v"
},
{
"d": {}
},
{
"d": []
},
{
"d": null
},
{
"d": -1
},
{
"d": 0
},
{
"d": 1
},
{
"d": "[object Object]"
},
{
"d": "{\"k\": \"v\"}"
},
{
"d": "{\"k\":\"v\"}"
},
"v"
]
Selector:
$[?(@.d=={"k":"v"})]
Test Data:
[
0,
42,
-1,
41,
43,
42.0001,
41.9999,
null,
100
]
Selector:
$[?(@==42)]
Test Data:
{
"a": {
"key": 0
},
"b": {
"key": 42
},
"c": {
"key": -1
},
"d": {
"key": 41
},
"e": {
"key": 43
},
"f": {
"key": 42.0001
},
"g": {
"key": 41.9999
},
"h": {
"key": 100
},
"i": {
"some": "value"
}
}
Selector:
$[?(@.key==42)]
Test Data:
{
"id": 2
}
Selector:
$[?(@.id==2)]
Test Data:
[
{
"key": "some"
},
{
"key": "value"
},
{
"key": null
},
{
"key": 0
},
{
"key": 1
},
{
"key": -1
},
{
"key": ""
},
{
"key": {}
},
{
"key": []
},
{
"key": "valuemore"
},
{
"key": "morevalue"
},
{
"key": [
"value"
]
},
{
"key": {
"some": "value"
}
},
{
"key": {
"key": "value"
}
},
{
"some": "value"
}
]
Selector:
$[?(@.key=="value")]
Test Data:
[
{
"some": "some value"
},
{
"key": true
},
{
"key": false
},
{
"key": null
},
{
"key": "value"
},
{
"key": ""
},
{
"key": 0
},
{
"key": 1
},
{
"key": -1
},
{
"key": 42
},
{
"key": {}
},
{
"key": []
}
]
Selector:
$[?(@.key==true)]
Test Data:
{
"value": 42,
"items": [
{
"key": 10
},
{
"key": 42
},
{
"key": 50
}
]
}
Selector:
$.items[?(@.key==$.value)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "43"
},
{
"key": "42"
},
{
"key": "41"
},
{
"key": "value"
},
{
"some": "value"
}
]
Selector:
$[?(@.key>42)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "43"
},
{
"key": "42"
},
{
"key": "41"
},
{
"key": "value"
},
{
"some": "value"
}
]
Selector:
$[?(@.key>=42)]
Test Data:
[
{
"d": 1
},
{
"d": 2
},
{
"d": 1
},
{
"d": 3
},
{
"d": 4
}
]
Selector:
$[?(@.d in [2, 3])]
Test Data:
[
{
"d": [
1,
2,
3
]
},
{
"d": [
2
]
},
{
"d": [
1
]
},
{
"d": [
3,
4
]
},
{
"d": [
4,
2
]
}
]
Selector:
$[?(2 in @.d)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "43"
},
{
"key": "42"
},
{
"key": "41"
},
{
"key": "value"
},
{
"some": "value"
}
]
Selector:
$[?(@.key<42)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "43"
},
{
"key": "42"
},
{
"key": "41"
},
{
"key": "value"
},
{
"some": "value"
}
]
Selector:
$[?(@.key<=42)]
Test Data:
[
{
"key": 60
},
{
"key": 50
},
{
"key": 10
},
{
"key": -50
},
{
"key*2": 100
}
]
Selector:
$[?(@.key*2==100)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "43"
},
{
"key": "42"
},
{
"key": "41"
},
{
"key": "value"
},
{
"some": "value"
}
]
Selector:
$[?(!(@.key==42))]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "43"
},
{
"key": "42"
},
{
"key": "41"
},
{
"key": "value"
},
{
"some": "value"
}
]
Selector:
$[?(!(@.key<42))]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "some"
},
{
"key": "42"
},
{
"key": null
},
{
"key": 420
},
{
"key": ""
},
{
"key": {}
},
{
"key": []
},
{
"key": [
42
]
},
{
"key": {
"key": 42
}
},
{
"key": {
"some": 42
}
},
{
"some": "value"
}
]
Selector:
$[?(@.key!=42)]
Test Data:
[
{
"name": "hullo world"
},
{
"name": "hello world"
},
{
"name": "yes hello world"
},
{
"name": "HELLO WORLD"
},
{
"name": "good bye"
}
]
Selector:
$[?(@.name=~/hello.*/)]
Test Data:
[
[
1,
2
],
[
3,
4
],
[
5,
6
]
]
Selector:
$[?(@[*]>=4)]
Test Data:
{
"x": [
[
1,
2
],
[
3,
4
],
[
5,
6
]
],
"y": [
3,
4,
5
]
}
Selector:
$.x[?(@[*]>=$.y[*])]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "some"
},
{
"key": "42"
},
{
"key": null
},
{
"key": 420
},
{
"key": ""
},
{
"key": {}
},
{
"key": []
},
{
"key": [
42
]
},
{
"key": {
"key": 42
}
},
{
"key": {
"some": 42
}
},
{
"some": "value"
}
]
Selector:
$[?(@.key=42)]
Test Data:
[
{
"a": [
{
"price": 1
},
{
"price": 3
}
]
},
{
"a": [
{
"price": 11
}
]
},
{
"a": [
{
"price": 8
},
{
"price": 12
},
{
"price": 3
}
]
},
{
"a": []
}
]
Selector:
$[?(@.a[?(@.price>10)])]
Test Data:
[
{
"key": 60
},
{
"key": 50
},
{
"key": 10
},
{
"key": -50
},
{
"key-50": -100
}
]
Selector:
$[?(@.key-50==-100)]
Test Data:
[
1,
3,
"nice",
true,
null,
false,
{},
[],
-1,
0,
""
]
Selector:
$[?(1==1)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "some"
},
{
"key": "42"
},
{
"key": null
},
{
"key": 420
},
{
"key": ""
},
{
"key": {}
},
{
"key": []
},
{
"key": [
42
]
},
{
"key": {
"key": 42
}
},
{
"key": {
"some": 42
}
},
{
"some": "value"
}
]
Selector:
$[?(@.key===42)]
Test Data:
[
{
"some": "some value"
},
{
"key": true
},
{
"key": false
},
{
"key": null
},
{
"key": "value"
},
{
"key": ""
},
{
"key": 0
},
{
"key": 1
},
{
"key": -1
},
{
"key": 42
},
{
"key": {}
},
{
"key": []
}
]
Selector:
$[?(@.key)]
Test Data:
[
{
"some": "some value"
},
{
"key": "value"
}
]
Selector:
$.*[?(@.key)]
Test Data:
{
"id": 2,
"more": [
{
"id": 2
},
{
"more": {
"id": 2
}
},
{
"id": {
"id": 2
}
},
[
{
"id": 2
}
]
]
}
Selector:
$..[?(@.id)]
Test Data:
[
1,
3,
"nice",
true,
null,
false,
{},
[],
-1,
0,
""
]
Selector:
$[?(false)]
Test Data:
[
{
"key": [
{
"child": 1
},
{
"child": 2
}
]
},
{
"key": [
{
"child": 2
}
]
},
{
"key": [
{}
]
},
{
"key": [
{
"something": 42
}
]
},
{}
]
Selector:
$[?(@..child)]
Test Data:
[
1,
3,
"nice",
true,
null,
false,
{},
[],
-1,
0,
""
]
Selector:
$[?(null)]
Test Data:
[
1,
3,
"nice",
true,
null,
false,
{},
[],
-1,
0,
""
]
Selector:
$[?(true)]
Test Data:
[
{
"key": 0
},
{
"key": 42
},
{
"key": -1
},
{
"key": 1
},
{
"key": 41
},
{
"key": 43
},
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": 100
},
{
"key": "some"
},
{
"key": "42"
},
{
"key": null
},
{
"key": 420
},
{
"key": ""
},
{
"key": {}
},
{
"key": []
},
{
"key": [
42
]
},
{
"key": {
"key": 42
}
},
{
"key": {
"some": 42
}
},
{
"some": "value"
}
]
Selector:
$[[email protected]==42]
Test Data:
[
{
"some": "some value"
},
{
"key": true
},
{
"key": false
},
{
"key": null
},
{
"key": "value"
},
{
"key": ""
},
{
"key": 0
},
{
"key": 1
},
{
"key": -1
},
{
"key": 42
},
{
"key": {}
},
{
"key": []
}
]
Selector:
$[?([email protected])]
Parens Notation
Test Data:
{
"key": 1,
"some": 2,
"more": 3
}
Selector:
$(key,more)
Recursive Descent
Test Data:
[
{
"a": {
"b": "c"
}
},
[
0,
1
]
]
Selector:
$..
Test Data:
{
"some key": "value",
"key": {
"complex": "string",
"primitives": [
0,
1
]
}
}
Selector:
$.key..
Script Expression
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[(@.length-1)]
Union
- Union With Filter
- Union With Keys After Dot Notation With Wildcard
- Union With Keys After Recursive Descent
- Union With Repeated Matches After Dot Notation With Wildcard
- Union With Slice And Number
- Union With Wildcard And Number
Test Data:
[
{
"key": 1
},
{
"key": 8
},
{
"key": 3
},
{
"key": 10
},
{
"key": 7
},
{
"key": 2
},
{
"key": 6
},
{
"key": 4
}
]
Selector:
$[?(@.key<3),?(@.key>6)]
Test Data:
[
{
"c": "cc1",
"d": "dd1",
"e": "ee1"
},
{
"c": "cc2",
"d": "dd2",
"e": "ee2"
}
]
Selector:
$.*['c','d']
Test Data:
[
{
"c": "cc1",
"d": "dd1",
"e": "ee1"
},
{
"c": "cc2",
"child": {
"d": "dd2"
}
},
{
"c": "cc3"
},
{
"d": "dd4"
},
{
"child": {
"c": "cc5"
}
}
]
Selector:
$..['c','d']
Test Data:
{
"a": [
"string",
null,
true
],
"b": [
false,
"string",
5.4
]
}
Selector:
$.*[0,:5]
Test Data:
[
1,
2,
3,
4,
5
]
Selector:
$[1:3,4]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[*,1]
The following queries are considered problematic, because they may lead to crashes of the PHP process.
Array Slice
- Array Slice With Large Number For Start
- Array Slice With Negative Step And Start Greater Than End
- Array Slice With Negative Step Only
- Array Slice With Open End And Negative Step
- Array Slice With Open Start And Negative Step
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[-113667776004:2]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[0:3:-2]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[::-2]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[3::-1]
Test Data:
[
"first",
"second",
"third",
"forth",
"fifth"
]
Selector:
$[:2:-1]