Bracket notation with number on object
Setup
Selector: $[0]
{
"0": "value"
}
Results
Consensus
[]
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).
null
Not found consensus
This consensus applies for implementations which return a specific not found value if no match exists.
NOT_FOUND
Scalar not found consensus
This consensus applies for implementations which returns a specific not found value when a query that would regularly return a single match results in no match.
NOT_FOUND
Other responses
"value"
"value"
[
"value"
]
JavaScript (Goessner)
²
[
"value"
]
JavaScript (brunerd)
[
"value"
]
JavaScript (jsonpath-plus)
[
"value"
]
JavaScript (jsonpathly)
[
"value"
]
PHP (Goessner)
²
[
"value"
]
PHP (galbar-jsonpath)
[
"value"
]
PHP (softcreatr-jsonpath)
[
"value"
]
Perl (JSON-Path)
[
"value"
]
Python (jsonpath)
²
[
"value"
]
Python (python-jsonpath)
[
"value"
]
Ruby (jsonpath)
[
null
]
dotNET (JsonPathLib)
[
"value"
]
dotNET (Manatee.Json)
[
"value"
]
Errors
Clojure (json-path)
¹
java.lang.Exception object must be an array.
object is not Slice
Python (jsonpath-ng)
KeyError(0)
Python (jsonpath-rw)
KeyError(0)
Footnotes
- ¹ This implementation returns a single value where only one match is possible (instead of an array of a single value).
- ² This implementation returns a specific not found value if no match exists.
- ³ This implementation returns a specific not found value if a query that would regularly return a single match results in no match.