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

Function more_make_expression_example

examples/src/jsonpath_examples.cpp:603–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601}
602
603void more_make_expression_example()
604{
605 auto expr = jsonpath::make_expression<jsoncons::json>("$.books[?(@.price > avg($.books[*].price))].title");
606
607 std::ifstream is("./input/books.json");
608 auto data =jsoncons::json::parse(is);
609
610 jsoncons::json result = expr.evaluate(data);
611 std::cout << pretty_print(result) << "\n\n";
612}
613
614void make_expression_with_callback_example()
615{

Callers 1

mainFunction · 0.85

Calls 3

parseFunction · 0.85
pretty_printFunction · 0.85
evaluateMethod · 0.45

Tested by

no test coverage detected