Filter expression with equals number for dot notation with star

Setup

Selector: $[?(@.*==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 `$[?(@.*==2)]': Invalid array index definition “?(@.*==2)]”

Clojure (json-path) ¹

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

Cpp (jsoncons)

[]

Dart (json_path)

Not supported

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

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

Parser error: Invalid token on line 1, syntax error before: <<"*">>

Erlang (ejsonpath)

[
  [
    2
  ]
]

Golang (github.com-PaesslerAG-jsonpath) ¹

[]

Golang (github.com-ohler55-ojg)

[
  [
    2,
    3
  ],
  [
    2
  ]
]

Golang (github.com-oliveagle-jsonpath) ¹

[
  [],
  [],
  [],
  [],
  []
]

Golang (github.com-spyzhov-ajson)

[
  [
    2
  ]
]

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

[
  [
    2
  ]
]

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(@.*==2)]
 Error: 1:7:
  |
1 | $[?(@.*==2)]
  |       ^
unexpected '*'
expecting "!=", "&&", "<=", "==", ">=", "||", '!', ')', '<', '>', or white space

JavaScript (brunerd)

Not supported

Java (com.github.jsurfer)

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

Java (com.jayway.jsonpath) ¹ ³

[]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[]

PHP (galbar-jsonpath) ²

[
  [
    2,
    3
  ],
  [
    2
  ]
]

PHP (remorhaz-jsonpath)

[
  [
    2,
    3
  ],
  [
    1
  ]
]

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)

Ruby (jsonpath)

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

Rust (jsonpath)

[]

Rust (jsonpath_lib)

[
  2
]

Rust (jsonpath_plus)

[
  [
    2
  ]
]

Scala (jsonpath)

[]

Swift (Sextant)

[]

dotNET (Json.NET)

[]

dotNET (JsonCons.JsonPath)

[]

dotNET (JsonPath.Net)

[
  [
    2
  ]
]

dotNET (Manatee.Json)

Not supported

The method or operation is not implemented.

JSON (Path_Reference_Implementation)

Not supported

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

Proposal (A)

Not supported


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

Errors

Elixir (ExJsonPath)

WithClauseError

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

path: unexpected end of path at 2

JavaScript (Goessner) ²

jsonPath: Unexpected token *=: _v.*==2

JavaScript (jsonpath)

Line 1: Unexpected token *=

JavaScript (jsonpath-plus)

jsonPath: Unexpected token '*=': _$_v.*==2

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

dotNET (JsonPathLib)

Line 1: Unexpected token *=

Footnotes