updates

This commit is contained in:
JMARyA 2025-05-06 23:43:23 +02:00
parent 77185abd6a
commit b1ad069731
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 114 additions and 8 deletions

View file

@ -2,7 +2,8 @@ use jsonfilter::{try_matches, FilterError};
use serde_json::{json, Value};
fn main() {
let filter = json!({"$and": [{"age": {"$gte": 18}}, {"age": {"$lte": 30}}]});
let filter = json!({"age": { "$range": [18, 30] }}); // same as:
// let filter = json!({"$and": [{"age": {"$gte": 18}}, {"age": {"$lte": 30}}]});
let obj1 = json!({"name": "John Doe", "age": 25});
let obj2 = json!({"name": "Alice Smith", "age": 35});