JSON query language interpreter.
This crate allows you to execute jq-like filters.
The example below demonstrates how to use this crate.
See the implementation in the jaq crate if you are interested in how to:
- enable usage of the standard library,
- load JSON files lazily,
- handle errors etc.
use ;
use ;
let input = json!;
let filter = ".[]";
// start out only from core filters,
// which do not include filters in the standard library
// such as `map`, `select` etc.
let defs = core;
// parse the filter in the context of the given definitions
let mut errs = Vecnew;
let f = parse.0.unwrap;
let f = defs.finish;
assert_eq!;
// iterator over the output values
let mut out = f.run;
assert_eq!;;
assert_eq!;;
assert_eq!;;