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)

Not supported

Instance of 'ParserException': end of input expected (at 1:2)

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

JavaScript (jsonpathly)

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

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}")

Python (python-jsonpath)

Not supported

JSONPathSyntaxError("expected ('FILTER_END', 'RBRACKET'), found 'INT'")

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"
  }
]

Rust (serde_json_path)

Not supported

at position 6, in long-hand segment, must start with lowercase alpha or '_'

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)

Not supported

Pattern '(@.2 == 's...' not recognized.

dotNET (Manatee.Json)

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

Errors

JavaScript (Goessner) ²

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

JavaScript (jsonpath)

Line 1: Unexpected number

JavaScript (jsonpath-plus)

Unexpected number

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

dotNET (JsonPathLib)

Line 1: Unexpected number

Footnotes