Filter expression with equals array for array slice with range 1

Setup

Selector: $[?(@[0:1]==[1])]

[[1, 2, 3], [1], [2, 3], 1, 2]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(@[0:1]==[1])]': Invalid array index definition “?(@[0:1]==[1])]”

Cpp (jsoncons)

[
  [
    1,
    2,
    3
  ],
  [
    1
  ]
]

Dart (json_path)

Not supported

FormatException: end of input expected at 1:2. Expression: $[?(@[0:1]==[1])]

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: '['

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(@[0:1]==[1])]	:1:13 - 1:14 unexpected "[" while scanning extensions

Golang (github.com-ohler55-ojg)

[]

Golang (github.com-vmware-labs-yaml-jsonpath)

Not supported

invalid filter term at position 12, following "=="

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(@[0:1]==[1])]
 Error: 1:8:
  |
1 | $[?(@[0:1]==[1])]
  |        ^
unexpected ':'
expecting '!', ']', digit, or white space

JavaScript (brunerd)

Not supported

Java (com.github.jsurfer)

Not supported

line 1:12 no viable alternative at input '@[0:1]==['
org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

[
  [
    1,
    2,
    3
  ],
  [
    1
  ]
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  [
    1,
    2,
    3
  ],
  [
    1
  ]
]

PHP (galbar-jsonpath) ²

[
  1,
  2
]

PHP (remorhaz-jsonpath)

[]

PHP (softcreatr-jsonpath)

[]

Python (jsonpath) ²

[
  [
    1,
    2,
    3
  ],
  [
    1
  ]
]

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:11 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}
ValueError("line 1:11 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)

Ruby (jsonpath)

[
  [
    1,
    2,
    3
  ],
  [
    1
  ],
  [
    2,
    3
  ],
  1,
  2
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

Not supported

path error: 
$[?(@[0:1]==[1])]
^^^^^^^^^^^^

Scala (jsonpath)

Not supported

JPError(end of input expected)

Swift (Sextant)

[
  [
    1,
    2,
    3
  ],
  [
    1
  ]
]

dotNET (Json.NET)

Not supported

Unexpected character while parsing path query: [

dotNET (JsonCons.JsonPath)

[
  [
    1,
    2,
    3
  ],
  [
    1
  ]
]

dotNET (JsonPath.Net)

[]

dotNET (Manatee.Json)

Not supported

JSON Path expression indexers only support single constant values. Path up to error: '$'

JSON (Path_Reference_Implementation)

Not supported

 --> 1:3
  |
1 | $[?(@[0:1]==[1])]
  |   ^---
  |
  = expected unionChild, unionArrayIndex, or sliceStart

Proposal (A)

Not supported


x 1:6-1:6 ComparisonOperator
| $[?(@[0:1]==[1])]
|      ^
| x 1:6-1:6 ScalarOperator
| | $[?(@[0:1]==[1])]
| |      ^
| o 1:5-1:6 DocumentValue
| | $[?(@[0:1]==[1])]
| |     ^
| o 1:5-1:6 UnaryFilterExpression
| | $[?(@[0:1]==[1])]
| |     ^
| | x 1:6-1:6 ScalarOperator
| | | $[?(@[0:1]==[1])]
| | |      ^
| | o 1:5-1:6 DocumentValue
| | | $[?(@[0:1]==[1])]
| | |     ^
| | o 1:5-1:6 FilterValue
| | | $[?(@[0:1]==[1])]
| | |     ^
| | | 
|/ /  
| | 
|/  
o 1:5-1:6 HigherPrecedenceFilterExpression
| $[?(@[0:1]==[1])]
|     ^
x 1:5-1:5 LogicalOr
| $[?(@[0:1]==[1])]
|     ^
| x 1:6-1:6 ComparisonOperator
| | $[?(@[0:1]==[1])]
| |      ^
| | x 1:6-1:6 ScalarOperator
| | | $[?(@[0:1]==[1])]
| | |      ^
| | o 1:5-1:6 DocumentValue
| | | $[?(@[0:1]==[1])]
| | |     ^
| | o 1:5-1:6 UnaryFilterExpression
| | | $[?(@[0:1]==[1])]
| | |     ^
| | | x 1:6-1:6 ScalarOperator
| | | | $[?(@[0:1]==[1])]
| | | |      ^
| | | o 1:5-1:6 DocumentValue
| | | | $[?(@[0:1]==[1])]
| | | |     ^
| | | o 1:5-1:6 FilterValue
| | | | $[?(@[0:1]==[1])]
| | | |     ^
| | | | 
| |/ /  
| | | 
| |/  
| o 1:5-1:6 HigherPrecedenceFilterExpression
| | $[?(@[0:1]==[1])]
| |     ^
| x 1:5-1:5 LogicalAnd
| | $[?(@[0:1]==[1])]
| |     ^
| | x 1:6-1:6 ComparisonOperator
| | | $[?(@[0:1]==[1])]
| | |      ^
| | | x 1:6-1:6 ScalarOperator
| | | | $[?(@[0:1]==[1])]
| | | |      ^
| | | o 1:5-1:6 DocumentValue
| | | | $[?(@[0:1]==[1])]
| | | |     ^
| | | o 1:5-1:6 UnaryFilterExpression
| | | | $[?(@[0:1]==[1])]
| | | |     ^
| | | | x 1:6-1:6 ScalarOperator
| | | | | $[?(@[0:1]==[1])]
| | | | |      ^
| | | | o 1:5-1:6 DocumentValue
| | | | | $[?(@[0:1]==[1])]
| | | | |     ^
| | | | o 1:5-1:6 FilterValue
| | | | | $[?(@[0:1]==[1])]
| | | | |     ^
| | | | | 
| | |/ /  
| | | | 
| | |/  
| | o 1:5-1:6 HigherPrecedenceFilterExpression
| | | $[?(@[0:1]==[1])]
| | |     ^
| | | 
|/ /  
| | 
|/  
o 1:5-1:6 FilterExpression
| $[?(@[0:1]==[1])]
|     ^
x 1:3-1:3 BracketElement
| $[?(@[0:1]==[1])]
|   ^
x 1:3-1:3 BracketElements
| $[?(@[0:1]==[1])]
|   ^
x 1:2-1:2 BracketChildren
| $[?(@[0:1]==[1])]
|  ^
x 1:2-1:2 Operator
| $[?(@[0:1]==[1])]
|  ^
o 1:1-1:2 Start
  $[?(@[0:1]==[1])]
  ^

Errors

Clojure (json-path) ¹

java.lang.Exception object must be an array.

Golang (github.com-bhmj-jsonslice) ¹ ³

unknown token at 8: [1] at 4

Golang (github.com-oliveagle-jsonpath) ¹

interface conversion: interface {} is nil, not string

Golang (github.com-spyzhov-ajson)

wrong request: wrong request: ?(@[0:1]==[1])

JavaScript (Goessner) ²

jsonPath: Unexpected token :: _v[0:1]==[1]

JavaScript (jsonpath)

Line 1: Unexpected token :

JavaScript (jsonpath-plus)

jsonPath: Unexpected token ':': _$_v[0:1]==[1]

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

non-safe evaluation, died at main.pl line 11.

Rust (jsonpath_plus)

Error Parsing JSON Path:
$[?(@[0:1]==[1])]
panic occurred

dotNET (JsonPathLib)

Line 1: Unexpected token :

Footnotes