0

Cannot use 'in' operator to search for JSONPath Online Evaluator. Can you you please help me why is throwing error message ? Is it syntax error ?

enter image description here

poovaraj
  • 609
  • 1
  • 6
  • 10
  • 1
    in means searching an array for a value but @.category is not an array. In this case you just want `$.store.book[?(@.category == 'fiction')]` – Jerry Jeremiah Jun 27 '23 at 04:59
  • 1
    If you make each `category` an array then `$.store.book[?('fiction' in @.category)]` won't work on https://jsonpath.com/ (and neither will multiple array filters). However, they will work on https://www.javainuse.com/jsonpath so I have started using the second site in preference to the first. – Jerry Jeremiah Jun 27 '23 at 05:02

0 Answers0