pub fn query(
doc: &Document,
path: &str,
config: &QueryConfig,
) -> QueryResult<Vec<Value>>Expand description
Query a HEDL document using JSONPath expression
§Arguments
doc- The HEDL document to querypath-JSONPathexpression (e.g.,$.users[*].name)config- Query configuration
§Returns
Vector of matching JSON values
§Examples
use hedl_json::jsonpath::{query, QueryConfig};
use hedl_core::Document;
fn example() -> Result<(), Box<dyn std::error::Error>> {
let doc = hedl_core::parse("users: [@User]\n u1 Alice 30".as_bytes())?;
let config = QueryConfig::default();
let results = query(&doc, "$.users", &config)?;
assert!(!results.is_empty());
Ok(())
}