Filter expression after dot notation with wildcard after recursive descent
Setup
Selector: $..*[?(@.id>2)]
[
{
"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
}
]
Results
Other responses
Bash (JSONPath.sh)
[
"another",
"more",
3,
4
]
C (json-glib)
Not supported
Unable to compile selector `$..*[?(@.id>2)]': Invalid array index definition “?(@.id>2)]”
Cpp (jsoncons)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Dart (json_path)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Elixir (ExJsonPath)
Not supported
syntax error before: '*'
Elixir (jaxon)
[]
Elixir (warpath)
¹
[
{
"complext": {
"more": {
"id": 5,
"name": "next to last"
},
"one": [
{
"id": 1,
"name": "first"
},
{
"id": 2,
"name": "next"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
]
}
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
},
{
"more": {
"id": 5,
"name": "next to last"
},
"one": [
{
"id": 1,
"name": "first"
},
{
"id": 2,
"name": "next"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
]
}
]
Erlang (ejsonpath)
[
"another",
"another",
"first",
"first",
"last",
"last",
"more",
"more",
"next to last",
"next to last",
"next",
"next",
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
[
{
"id": 1,
"name": "first"
},
{
"id": 2,
"name": "next"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
],
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"more": {
"id": 5,
"name": "next to last"
},
"one": [
{
"id": 1,
"name": "first"
},
{
"id": 2,
"name": "next"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
]
}
]
Not supported
parsing error: $..*[?(@.id>2)] :1:12 - 1:13 unexpected ">" while scanning parentheses expected ")"
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
]
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
Haskell (jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
JavaScript (Goessner)
²
[
"another",
"last",
"more",
"next to last",
3,
4,
5,
6,
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
]
JavaScript (brunerd)
[
"another",
"last",
"more",
"next to last",
3,
4,
5,
6,
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
}
]
JavaScript (jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
JavaScript (jsonpath-plus)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Java (com.github.jsurfer)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Java (com.jayway.jsonpath)
¹
³
[
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=?, index=5
Objective-C (SMJJSONPath)
¹
³
[
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
PHP (galbar-jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
PHP (remorhaz-jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
PHP (softcreatr-jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Python (jsonpath)
²
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Python (jsonpath-ng)
Not supported
JsonPathLexerError('Error on line 1, col 5: Unexpected character: ? ')
Python (jsonpath-rw)
Not supported
JsonPathLexerError('Error on line 1, col 5: Unexpected character: ? ')
Python (jsonpath2)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
Raku (JSON-Path)
Not supported
Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)
Ruby (jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
},
{
"id": 6,
"name": "last"
},
{
"id": 6,
"name": "last"
}
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
Rust (jsonpath_plus)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Scala (jsonpath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
Swift (Sextant)
[
{
"id": 3,
"name": "another"
},
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
},
{
"id": 6,
"name": "last"
}
]
dotNET (Json.NET)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 6,
"name": "last"
}
]
dotNET (JsonCons.JsonPath)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
dotNET (JsonPath.Net)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
dotNET (JsonPathLib)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
dotNET (Manatee.Json)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $..*[?(@.id>2)]
| ^---
|
= expected childName
Proposal (A)
[
{
"id": 3,
"name": "another"
},
{
"id": 4,
"name": "more"
},
{
"id": 5,
"name": "next to last"
}
]
Errors
Clojure (json-path)
¹
java.lang.IllegalArgumentException Don't know how to create ISeq from: java.lang.Integer
expression don't support in filter
PHP (Goessner)
²
ArgumentCountError
Perl (JSON-Path)
non-safe evaluation, died at main.pl line 11.
Footnotes
- ¹ This implementation returns a single value where only one match is possible (instead of an array of a single value).
- ² This implementation returns a specific not found value if no match exists.
- ³ This implementation returns a specific not found value if a query that would regularly return a single match results in no match.