0

I have the following JSON:

{ "value": { "activate": false } }

I want the JSONPath value to returned as true, but on applying the filter as below:

$.value.?(@.activate==false)

I get an invalid result.

Is there anything wrong with the JSONPath?

  • Can you clarify what you're expecting to be returned? JSON Path is a query language, so you should expect to get a subset of the values contained within the original document. The path you're using is invalid, but to help properly, I need to know what you want to do. – gregsdennis Sep 06 '21 at 09:25
  • @gregsdennis Thank you for your response. I am trying to evaluate the condition $.value.?(@.activate==false) and have it returned as true. Is there a way to go about that? – Swati Baleri Sep 16 '21 at 05:24

1 Answers1

1

The syntax for filter queries needs brackets.

$.value[?(@.activate==false)]
gregsdennis
  • 7,218
  • 3
  • 38
  • 71