Bracket notation with number -1

Setup

Selector: $[-1]

["first", "second", "third"]

Results

Consensus

[
  "third"
]

Scalar consensus

The scalar consensus applies for implementations which return a single value where only one match is possible (instead of an array of a single value).

"third"

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

[]

Elixir (jaxon)

[]

JavaScript (Goessner) ²

Not found

jsonpath returned false, this might indicate an error

JavaScript (jsonpath)

[]

JavaScript (jsonpath-plus)

[]

Java (com.github.jsurfer)

[]

PHP (Goessner) ²

Not found

jsonpath returned false, this might indicate an error

Python (jsonpath) ²

Not found

jsonpath returned false, this might indicate an error

Raku (JSON-Path)

Not supported

JSON path parse error at position 1

Rust (jsonpath)

Not supported

parsing error

dotNET (JsonPathLib)

[]

Errors

Golang (github.com-PaesslerAG-jsonpath) ¹

index -1 out of bounds

dotNET (Json.NET)

Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

Footnotes