acesario
6 years agoContributor II
JSONPath where key or value starts with @ character?
0
I am attempting get a value based on the key containing @ symbol fails using JSONPath.
Cause: Since @ is the current object/element, json does not return the value.
Sample 1: { “firstName”: “...
- 6 years ago
I believe this expression will give you the filter you are looking for:
jsonPath($.phoneNumbers, "[?(jsonPath(@, '@**type') == 'iPhone')]")if you’d like to collect the ‘@**type’ values then this is the expression you are looking for:
jsonPath($.phoneNumbers, "[?(jsonPath(@, '@**type') == 'iPhone')].@**type")