How to filter by string in JSONPath?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a JSON response from the Facebook API that looks like this: { "data": [ { "name": "Barack Obama", "category": "Politician", "id": "6815841748" }, { "name": "Barack Obama's Dead Fly", "category": "Public figure", "id": "92943557739" }] } I want to apply JSONPath to it to only return results with a category of "Politician". From what I've read, it appears that I need to do: $.data[?(@.category=='Politician')] but according to the testing tool I found, this doesn't work. I found another question which suggests that I should use "eq"