jsonfilter 0.2.1

Filter and compare JSON objects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use jsonfilter::matches;
use serde_json::json;

fn main() {
    let filter = json!({"name": "John", "age": 30});
    let obj = json!({"name": "John", "age": 30, "city": "New York"});

    println!("Applying filter:");
    println!("{}", filter);
    println!("To object:");
    println!("{}", obj);
    if matches(&filter, &obj) {
        println!("Filter matches the object");
    } else {
        println!("Filter does not match the object");
    }
}