json - How to filter list by nested element using JSONPath? -
how can 1 filter list of items nested value using jsonpath?
test data
[{ "identifiers": [ { "extension": "foo" } ] }, { "identifiers": [ { "extension": "bar" }, { "extension": "baz" } ] }]
expected result
[{ "identifiers": [ { "extension": "foo" } ] }]
i've tried following, none of them work. used jsonpath tester validate results.
$[?(@.identifiers.[*].extension == 'foo')] $[?(@.identifiers.*.extension == 'foo')] $[?(@.identifiers[0].extension == 'foo')]
this
$..identifiers.[?(@.extension == "foo")]
works @ http://jsonpath.herokuapp.com/ when use goessner.
at http://jsonpath.curiousconcept.com/ keep getting errors.
Comments
Post a Comment