Union with filter
Setup
Selector: $[?(@.key<3),?(@.key>6)]
[{"key": 1}, {"key": 8}, {"key": 3}, {"key": 10}, {"key": 7}, {"key": 2}, {"key": 6}, {"key": 4}]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[?(@.key<3),?(@.key>6)]': Invalid array index definition “?(@.key<3),?(@.key>6)]”
Clojure (json-path)
¹
[
{
"key": 1
},
{
"key": 2
}
]
Cpp (jsoncons)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
Dart (json_path)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
Elixir (ExJsonPath)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
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
invalid syntax (position=1, reason=unrecognized input, near=[?(@.key<3),?(@.key>6)])
Not supported
parsing error: $[?(@.key<3),?(@.key>6)] :1:10 - 1:11 unexpected "<" while scanning parentheses expected ")"
Not supported
[]
Not supported
invalid filter expression at position 12, following ")"
Haskell (jsonpath)
Not supported
Invalid JSONPath: $[?(@.key<3),?(@.key>6)]
Error: 1:13:
|
1 | $[?(@.key<3),?(@.key>6)]
| ^^
unexpected ",?"
expecting "&&", "||", ']', or white space
JavaScript (brunerd)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
Java (com.github.jsurfer)
Not supported
org.antlr.v4.runtime.misc.ParseCancellationException
Java (com.jayway.jsonpath)
¹
³
Not supported
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
com.jayway.jsonpath.InvalidPathException: Could not parse token starting at position 1. Expected ?, ', 0-9, *
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=?, index=2
Objective-C (SMJJSONPath)
¹
³
Not supported
Could not parse token starting at position 1 . Expected ?, ', 0-9, *
PHP (galbar-jsonpath)
²
Not supported
Invalid JSONPath error: 'Error in JSONPath near '<3),?(@.key''
PHP (remorhaz-jsonpath)
Not supported
Error: 'Failed to build AST from JSONPath query: $[?(@.key<3),?(@.key>6)]'
PHP (softcreatr-jsonpath)
[
{
"key": 1
},
{
"key": 3
},
{
"key": 10
},
{
"key": 2
}
]
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)
[]
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Ruby (jsonpath)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$[?(@.key<3),?(@.key>6)]
^^^^^^^^^^^^^
Rust (jsonpath_plus)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
Scala (jsonpath)
Not supported
JPError(end of input expected)
Swift (Sextant)
Not supported
NOT_SUPPORTED
dotNET (Json.NET)
Not supported
Unexpected character while parsing path indexer: ,
dotNET (JsonCons.JsonPath)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
dotNET (JsonPath.Net)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
dotNET (Manatee.Json)
Not supported
Unrecognized JSON Path Expression element. Path up to error: '$'
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $[?(@.key<3),?(@.key>6)]
| ^---
|
= expected unionChild, unionArrayIndex, or sliceStart
Proposal (A)
[
{
"key": 1
},
{
"key": 2
},
{
"key": 8
},
{
"key": 10
},
{
"key": 7
}
]
Errors
path: invalid character at 12
wrong request: wrong request: ?(@.key<3),?(@.key>6)
JavaScript (Goessner)
²
jsonPath: Unexpected token ): _v.key<3),?(_v.key>6
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.
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.