You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I use jsonpath in one of my projects. It works perfectly for most of my use-cases.
Nonetheless, I need to do something like this:
$..[? @.example ]
So, basically I want to get (recursively) all nodes that have a property named example.
Is that query possible in jsonpath?
I've tried a couple of similar queries and they didn't work for me - no results found.
I don't know if that's a feature, a bug or something that requires hacking GVal expressions?
Could you help me/point in a good direction?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Does $..[?(@.example)] work for you? For the input {"example": [{"example": null}], "key": {"example": {"example": 42}}} this implementation returns [{"example": 42}].
Hey @cburgmer, thanks for your comment. Here's an example which should give you more context about my initial question: https://play.golang.org/p/rB4wROddiNP
I would be glad if you could look at this. I don't know if the structure of the JSON objects in my projects is weird (?) Maybe there's an error in my way of using jsonpath.
Hello,
I use
jsonpath
in one of my projects. It works perfectly for most of my use-cases.Nonetheless, I need to do something like this:
So, basically I want to get (recursively) all nodes that have a property named
example
.Is that query possible in
jsonpath
?I've tried a couple of similar queries and they didn't work for me - no results found.
I don't know if that's a feature, a bug or something that requires hacking GVal expressions?
Could you help me/point in a good direction?
Thanks in advance!
The text was updated successfully, but these errors were encountered: