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" instead of "==", but that doesn't work either. What am I getting wrong here?