MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / union_example

Function union_example

examples/src/jsonpath_examples.cpp:714–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714void union_example()
715{
716 std::ifstream is("./input/store.json");
717 jsoncons::json store = jsoncons::json::parse(is);
718
719 std::string path = "$.store.book[0:2,-1,?(@.author=='Herman Melville')].title";
720 auto result1 = jsonpath::json_query(store, path);
721 std::cout << "(1) " << result1 << "\n\n";
722
723 auto result2 = jsonpath::json_query(store, path, jsonpath::result_options::path);
724 std::cout << "(2) " << result2 << "\n\n";
725}
726
727void parent_operator_example()
728{

Callers 1

mainFunction · 0.85

Calls 2

parseFunction · 0.85
json_queryFunction · 0.85

Tested by

no test coverage detected