Consider this sample JSON:
{
"thing": [
{
"name": "foo",
"flag": "yep"
},
{
"name": "bar"
},
{
"name": "baz",
"flag": "nope"
}
]
}
If I wanted to find all the 'name' elements that DID have a corresponding 'flag', I could use something like this:
$.thing[?(@.flag)].name
I would get back the results:
'0' => "foo"
'1' => "baz"
But what if I wanted to find all the 'name' elements that DID NOT have a corresponding 'flag'?
(for the purposes of this question, I don't care about the value of 'flag', only whether or not it's present)