From e36696661061a4642454ebb9620ec4f0ba1f6523 Mon Sep 17 00:00:00 2001 From: MonkeybreadSoftware Date: Sun, 24 Sep 2023 12:55:12 +0200 Subject: [PATCH] Update jsonpath_examples.cpp The original example returns empty result. If you use &&, the result works. --- examples/src/jsonpath_examples.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/src/jsonpath_examples.cpp b/examples/src/jsonpath_examples.cpp index 3dd97f44c..0ffedb355 100644 --- a/examples/src/jsonpath_examples.cpp +++ b/examples/src/jsonpath_examples.cpp @@ -59,7 +59,7 @@ void json_query_examples() std::cout << "(9)\n" << pretty_print(result9) << "\n"; // Intersection of book titles with category fiction and price < 15 - json result10 = jsonpath::json_query(booklist, "$.store.book[?(@.category == 'fiction')][?(@.price < 15)].title"); + json result10 = jsonpath::json_query(booklist, "$.store.book[?(@.category == 'fiction' && @.price < 15)].title")); std::cout << "(10)\n" << pretty_print(result10) << "\n"; // Normalized path expressions