Filter expression with equals array for dot notation with star
Setup
Selector: $[?(@.*==[1,2])]
[[1,2], [2,3], [1], [2], [1, 2, 3], 1, 2, 3]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[?(@.*==[1,2])]': Invalid array index definition “?(@.*==[1,2])]”
Cpp (jsoncons)
[
[
1,
2
]
]
Dart (json_path)
Not supported
end of input expected at 1:2
Elixir (ExJsonPath)
Not supported
syntax error before: '['
Elixir (jaxon)
[]
Elixir (warpath)
¹
Not supported
Parser error: Invalid token on line 1, syntax error before: <<"*">>
Erlang (ejsonpath)
Not supported
syntax error before: '['
Not supported
parsing error: $[?(@.*==[1,2])] :1:10 - 1:11 unexpected "[" while scanning extensions
[]
Not supported
invalid filter term at position 9, following "=="
Haskell (jsonpath)
Not supported
Invalid JSONPath: $[?(@.*==[1,2])]
Error: 1:7:
|
1 | $[?(@.*==[1,2])]
| ^
unexpected '*'
expecting "!=", "&&", "<=", "==", ">=", "||", '!', ')', '<', '>', or white space
JavaScript (brunerd)
Not supported
Java (com.github.jsurfer)
Not supported
line 1:9 no viable alternative at input '@.*==['
org.antlr.v4.runtime.misc.ParseCancellationException
Java (com.jayway.jsonpath)
¹
³
[
[
1,
2
]
]
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=?, index=2
Objective-C (SMJJSONPath)
¹
³
[
[
1,
2
]
]
PHP (galbar-jsonpath)
[
1,
2,
3
]
PHP (remorhaz-jsonpath)
[]
PHP (softcreatr-jsonpath)
[]
Python (jsonpath)
²
Not found
jsonpath returned false, this might indicate an error
Python (jsonpath-ng)
Not supported
JsonPathLexerError('Error on line 1, col 2: Unexpected character: ? ')
Python (jsonpath-rw)
Not supported
JsonPathLexerError('Error on line 1, col 2: Unexpected character: ? ')
Python (jsonpath2)
Not supported
line 1:8 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}
ValueError("line 1:8 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}")
Raku (JSON-Path)
Not supported
Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$[?(@.*==[1,2])]
^^^^^^^^^
Scala (jsonpath)
Not supported
JPError(end of input expected)
Swift (Sextant)
[
[
1,
2
]
]
dotNET (Json.NET)
Not supported
Unexpected character while parsing path query: [
dotNET (JsonCons.JsonPath)
[
[
1,
2
]
]
dotNET (JsonPath.Net)
Not supported
Pattern '(@.*==[1,2...' not recognized.
dotNET (Manatee.Json)
Not supported
The method or operation is not implemented.
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $[?(@.*==[1,2])]
| ^---
|
= expected unionChild, unionArrayIndex, or sliceStart
Proposal (A)
Not supported
x 1:7-1:7 DotChildName
| $[?(@.*==[1,2])]
| ^
x 1:6-1:6 ScalarOperator
| $[?(@.*==[1,2])]
| ^
o 1:5-1:6 DocumentValue
| $[?(@.*==[1,2])]
| ^
o 1:5-1:6 UnaryFilterExpression
| $[?(@.*==[1,2])]
| ^
| x 1:7-1:7 DotChildName
| | $[?(@.*==[1,2])]
| | ^
| x 1:6-1:6 ScalarOperator
| | $[?(@.*==[1,2])]
| | ^
| o 1:5-1:6 DocumentValue
| | $[?(@.*==[1,2])]
| | ^
| o 1:5-1:6 FilterValue
| | $[?(@.*==[1,2])]
| | ^
| |
|/
o 1:5-1:6 HigherPrecedenceFilterExpression
| $[?(@.*==[1,2])]
| ^
x 1:5-1:5 LogicalOr
| $[?(@.*==[1,2])]
| ^
| x 1:7-1:7 DotChildName
| | $[?(@.*==[1,2])]
| | ^
| x 1:6-1:6 ScalarOperator
| | $[?(@.*==[1,2])]
| | ^
| o 1:5-1:6 DocumentValue
| | $[?(@.*==[1,2])]
| | ^
| o 1:5-1:6 UnaryFilterExpression
| | $[?(@.*==[1,2])]
| | ^
| | x 1:7-1:7 DotChildName
| | | $[?(@.*==[1,2])]
| | | ^
| | x 1:6-1:6 ScalarOperator
| | | $[?(@.*==[1,2])]
| | | ^
| | o 1:5-1:6 DocumentValue
| | | $[?(@.*==[1,2])]
| | | ^
| | o 1:5-1:6 FilterValue
| | | $[?(@.*==[1,2])]
| | | ^
| | |
| |/
| o 1:5-1:6 HigherPrecedenceFilterExpression
| | $[?(@.*==[1,2])]
| | ^
| x 1:5-1:5 LogicalAnd
| | $[?(@.*==[1,2])]
| | ^
| | x 1:7-1:7 DotChildName
| | | $[?(@.*==[1,2])]
| | | ^
| | x 1:6-1:6 ScalarOperator
| | | $[?(@.*==[1,2])]
| | | ^
| | o 1:5-1:6 DocumentValue
| | | $[?(@.*==[1,2])]
| | | ^
| | o 1:5-1:6 UnaryFilterExpression
| | | $[?(@.*==[1,2])]
| | | ^
| | | x 1:7-1:7 DotChildName
| | | | $[?(@.*==[1,2])]
| | | | ^
| | | x 1:6-1:6 ScalarOperator
| | | | $[?(@.*==[1,2])]
| | | | ^
| | | o 1:5-1:6 DocumentValue
| | | | $[?(@.*==[1,2])]
| | | | ^
| | | o 1:5-1:6 FilterValue
| | | | $[?(@.*==[1,2])]
| | | | ^
| | | |
| | |/
| | o 1:5-1:6 HigherPrecedenceFilterExpression
| | | $[?(@.*==[1,2])]
| | | ^
| | |
|/ /
| |
|/
o 1:5-1:6 FilterExpression
| $[?(@.*==[1,2])]
| ^
x 1:3-1:3 BracketElement
| $[?(@.*==[1,2])]
| ^
x 1:3-1:3 BracketElements
| $[?(@.*==[1,2])]
| ^
x 1:2-1:2 BracketChildren
| $[?(@.*==[1,2])]
| ^
x 1:2-1:2 Operator
| $[?(@.*==[1,2])]
| ^
o 1:1-1:2 Start
$[?(@.*==[1,2])]
^
Errors
Clojure (json-path)
¹
java.lang.Exception object must be an array.
unknown token at 5: [1,2] at 4
interface conversion: interface {} is nil, not string
wrong request: wrong request: ?(@.*==[1,2])
JavaScript (Goessner)
²
jsonPath: Unexpected token *=: _v.*==[1,2]
JavaScript (jsonpath)
Line 1: Unexpected token *=
JavaScript (jsonpath-plus)
Unexpected token '*='
PHP (Goessner)
²
ArgumentCountError
Perl (JSON-Path)
non-safe evaluation, died at main.pl line 11.
Ruby (jsonpath)
unmatched parenthesis in expression: (true
Rust (jsonpath_plus)
Error Parsing JSON Path:
$[?(@.*==[1,2])]
panic occurred
dotNET (JsonPathLib)
Line 1: Unexpected token *=
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.