Skip to content

Commit

Permalink
Update json_query.md
Browse files Browse the repository at this point in the history
Changed examples 8 and 9 to match expression in jsonpath_examples.cpp file, so they parse well.
  • Loading branch information
MonkeybreadSoftware authored Sep 24, 2023
1 parent 8e77f7c commit ba4f04c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/ref/jsonpath/json_query.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ int main()
std::cout << "(7)\n" << pretty_print(result7) << "\n";

// Union of a subset of book titles identified by index
json result8 = jsonpath::json_query(root_value, "$.store[book[0].title,book[1].title,book[3].title]");
json result8 = jsonpath::json_query(root_value, "$.store[@.book[0].title,@.book[1].title,@.book[3].title]");
std::cout << "(8)\n" << pretty_print(result8) << "\n";

// Union of third book title and all book titles with price > 10
json result9 = jsonpath::json_query(root_value, "$.store[book[3].title,book[?(@.price > 10)].title]");
json result9 = jsonpath::json_query(root_value, "$.store[@.book[3].title,@.book[?(@.price > 10)].title]");
std::cout << "(9)\n" << pretty_print(result9) << "\n";

// Intersection of book titles with category fiction and price < 15
Expand Down

0 comments on commit ba4f04c

Please sign in to comment.