Filter expression with dot notation with dash
Setup
Selector: $[?(@.key-dash == 'value')]
[
{
"key-dash": "value"
}
]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[?(@.key-dash == 'value')]': Invalid array index definition “?(@.key-dash == 'value')]”
Clojure (json-path)
¹
[]
Cpp (jsoncons)
Not supported
JSON syntax_error at line 1 and column 15
Dart (json_path)
Not supported
end of input expected at 1:2
Elixir (ExJsonPath)
Not supported
illegal characters "-d"
Elixir (jaxon)
[]
Elixir (warpath)
¹
[
{
"key-dash": "value"
}
]
Erlang (ejsonpath)
Not supported
syntax error before: '=='
Not supported
parsing error: $[?(@.key-dash == 'value')] :1:10 - 1:11 unexpected "-" while scanning parentheses expected ")"
[]
Not supported
[]
[
{
"key-dash": "value"
}
]
Haskell (jsonpath)
[
{
"key-dash": "value"
}
]
JavaScript (brunerd)
Not supported
JavaScript (jsonpath)
[]
Java (com.github.jsurfer)
[
{
"key-dash": "value"
}
]
Java (com.jayway.jsonpath)
¹
³
[
{
"key-dash": "value"
}
]
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=?, index=2
Objective-C (SMJJSONPath)
¹
³
[
{
"key-dash": "value"
}
]
PHP (galbar-jsonpath)
[
{
"key-dash": "value"
}
]
PHP (remorhaz-jsonpath)
[
{
"key-dash": "value"
}
]
PHP (softcreatr-jsonpath)
[
{
"key-dash": "value"
}
]
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:9 token recognition error at: '-d'
ValueError("line 1:9 token recognition error at: '-d'")
Raku (JSON-Path)
Not supported
Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)
Ruby (jsonpath)
[]
Rust (jsonpath)
[
{
"key-dash": "value"
}
]
Rust (jsonpath_lib)
[
{
"key-dash": "value"
}
]
Rust (jsonpath_plus)
[
{
"key-dash": "value"
}
]
Scala (jsonpath)
[
{
"key-dash": "value"
}
]
Swift (Sextant)
[
{
"key-dash": "value"
}
]
dotNET (Json.NET)
[
{
"key-dash": "value"
}
]
dotNET (JsonCons.JsonPath)
Not supported
Expected function
dotNET (JsonPath.Net)
Not supported
Pattern '(@.key-das...' not recognized.
dotNET (Manatee.Json)
Not supported
Unrecognized JSON Path Expression element. Path up to error: '$'
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $[?(@.key-dash == 'value')]
| ^---
|
= expected unionChild, unionArrayIndex, or sliceStart
Proposal (A)
[
{
"key-dash": "value"
}
]
Errors
wrong request: wrong request: ?(@.key-dash == 'value')
JavaScript (Goessner)
²
jsonPath: dash is not defined: _v.key-dash == 'value'
JavaScript (jsonpath-plus)
jsonPath: dash is not defined: @.key-dash == 'value'
PHP (Goessner)
²
ArgumentCountError
Perl (JSON-Path)
non-safe evaluation, died at main.pl line 11.
dotNET (JsonPathLib)
dash is not defined
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.