jsonpath-online-evaluator icon indicating copy to clipboard operation
jsonpath-online-evaluator copied to clipboard

get value for the key "$" fails

Open dlukyanov opened this issue 6 years ago • 1 comments
trafficstars

assume this json

{"$":123, "$a":456}

the following expression works fine:

$['$a']

however this expression returns the whole json:

$['$']

when it should return 123

dlukyanov avatar Aug 21 '19 08:08 dlukyanov

hey @dlukyanov , did you found solution for your question? I just came across the same and I've found solution here: https://github.com/s3u/JSONPath

(e.g.,$ to match a property literally named $)

you have to use backtick to escape $, like so:

$.`$

kumarunster avatar Jan 22 '20 21:01 kumarunster