search.md
May 24, 2023 ยท View on GitHub
jsoncons::jmespath::search
#include <jsoncons_ext/jmespath/jmespath.hpp>
template<Json>
Json search(const Json& doc,
const Json::string_view_type& expr); (1)
template<Json>
Json search(const Json& doc,
const Json::string_view_type& expr,
std::error_code& ec); (2)
Returns a Json value.
Parameters
| doc | Json value |
| expr | JMESPath expression |
| ec | out-parameter for reporting errors in the non-throwing overload |
Return value
Returns a Json value.
Exceptions
(1) Throws a jmespath_error if JMESPath evaluation fails.
(2) Sets the out-parameter ec to the jmespath_error_category if JMESPath evaluation fails.