Filter expression with greater than string
Setup
Selector: $[?(@.key>"VALUE")]
[
{"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": "alpha"},
{"key": "ALPHA"},
{"key": "value"},
{"key": "VALUE"},
{"some": "value"},
{"some": "VALUE"}
]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[?(@.key>"VALUE")]': Invalid array index definition “?(@.key>"VALUE")]”
Cpp (jsoncons)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Dart (json_path)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Elixir (ExJsonPath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Erlang (ejsonpath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Not supported
invalid syntax (position=1, reason=unrecognized input, near=[?(@.key>"VALUE")])
Not supported
parsing error: $[?(@.key>"VALUE")] :1:10 - 1:11 unexpected ">" while scanning parentheses expected ")"
[
{
"key": "alpha"
},
{
"key": "value"
}
]
[
{
"key": "alpha"
},
{
"key": "value"
}
]
[]
[
{
"key": "alpha"
},
{
"key": "value"
}
]
[]
Haskell (jsonpath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
JavaScript (Goessner)
²
[
{
"key": "alpha"
},
{
"key": "value"
}
]
JavaScript (brunerd)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
JavaScript (jsonpath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
JavaScript (jsonpath-plus)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Java (com.github.jsurfer)
Not supported
org.antlr.v4.runtime.misc.ParseCancellationException
Java (com.jayway.jsonpath)
¹
³
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=?, index=2
Objective-C (SMJJSONPath)
¹
³
[
{
"key": "alpha"
},
{
"key": "value"
}
]
PHP (galbar-jsonpath)
²
[
{
"key": "alpha"
},
{
"key": "value"
}
]
PHP (remorhaz-jsonpath)
[]
PHP (softcreatr-jsonpath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Python (jsonpath)
²
[
{
"key": "alpha"
},
{
"key": "value"
}
]
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)
[]
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)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Rust (jsonpath_plus)
[]
Scala (jsonpath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Swift (Sextant)
[
{
"key": 42.0001
},
{
"key": 41.9999
},
{
"key": "alpha"
},
{
"key": "value"
}
]
dotNET (Json.NET)
Not supported
Unexpected character while parsing path query: "
dotNET (JsonCons.JsonPath)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
dotNET (JsonPath.Net)
[]
dotNET (JsonPathLib)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
dotNET (Manatee.Json)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $[?(@.key>"VALUE")]
| ^---
|
= expected unionChild, unionArrayIndex, or sliceStart
Proposal (A)
[
{
"key": "alpha"
},
{
"key": "value"
}
]
Errors
Clojure (json-path)
¹
java.lang.ClassCastException class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')
PHP (Goessner)
²
ArgumentCountError
Perl (JSON-Path)
non-safe evaluation, died at main.pl line 11.
Ruby (jsonpath)
comparison of Float with String failed
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.