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 ?
Asked
Active
Viewed 38 times
0
-
1in 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
-
1If 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