Filter expression with dot notation with number

Setup

Selector: $[?(@.2 == 'second')]

[{"a": "first", "2": "second", "b": "third"}]   

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

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

Clojure (json-path) ¹

[]

Cpp (jsoncons)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Dart (json_path)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Elixir (ExJsonPath)

[]

Elixir (jaxon)

[]

Elixir (warpath) ¹

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Erlang (ejsonpath)

Not supported

syntax error before: 2

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(@.2 == 'second')]	:1:6 - 1:8 unexpected Float while scanning parentheses expected ")"

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

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Golang (github.com-ohler55-ojg)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Golang (github.com-oliveagle-jsonpath) ¹

[]

Golang (github.com-spyzhov-ajson)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

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

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Haskell (jsonpath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

JavaScript (brunerd)

Not supported

Java (com.github.jsurfer)

[]

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

PHP (galbar-jsonpath) ²

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

PHP (remorhaz-jsonpath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

PHP (softcreatr-jsonpath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

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:6 mismatched input '2' expecting {'*', ID}
ValueError("line 1:6 mismatched input '2' expecting {'*', ID}")

Raku (JSON-Path)

Not supported

Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)

Ruby (jsonpath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Rust (jsonpath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Rust (jsonpath_lib)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Rust (jsonpath_plus)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Scala (jsonpath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Swift (Sextant)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

dotNET (Json.NET)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

dotNET (JsonCons.JsonPath)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

dotNET (JsonPath.Net)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

dotNET (Manatee.Json)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

JSON (Path_Reference_Implementation)

Not supported

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

Proposal (A)

[
  {
    "2": "second",
    "a": "first",
    "b": "third"
  }
]

Errors

JavaScript (Goessner) ²

jsonPath: Unexpected number: _v.2 == 'second'

JavaScript (jsonpath)

Line 1: Unexpected number

JavaScript (jsonpath-plus)

jsonPath: Unexpected number: _$_v.2 == 'second'

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

dotNET (JsonPathLib)

Line 1: Unexpected number

Footnotes