INNER CODE UNIT · Rust

parse_leaf_value

fcoury/oxide · src/parser/mod.rs:416

fn parse_leaf_value(leaf_value: LeafValue, f: String, operator: Option<&str>) -> Result<String> {
    let json = leaf_value.value;
    let mut field = field_to_jsonb(&f);

    if json.is_object() {
        let obj = json.as_object().unwrap();

        if obj.contains_key("$d") {
            let oper = operator.unwrap_or("=");
            return Ok(format!(
                "{}->'$d' {} {}",
                field,
                oper,
                str_to_jsonb(obj["$d"].to_string())
            ));
        } else {
            return parse_object(&f, obj);
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…