Open jet10000 opened 3 years ago
Something like this?
values(@)[*].values(@)[?contains(content, 'two')][]
https://codesandbox.io/s/cranky-flower-4ufz4?file=/src/index.js
returns:
[
{
"content": "this two"
}
]
I can't think of a way of returning the exact structure you are looking for using standard JMESPath. But you might manage it using an extension like this: https://github.com/daz-is/jmespath-plus
I expect the returned result can retain the original json hierarchy, only need to exclude entries that do not contain keywords.
json
I want to filter contains "two" keyword and want to return this type of result