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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -