INNER CODE UNIT · Rust

translate_operator

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

fn translate_operator(oper: &str) -> &str {
    match oper {
        "$lt" => "<",
        "$lte" => "<=",
        "$gt" => ">",
        "$gte" => ">=",
        "$ne" => "!=",
        "$eq" => "=",
        other => other,
    }
}

fn parse_value_operator(value_oper: ValueOperator, field: String) -> Result<String> {
    let operator = match value_oper.operator.as_str() {
        "$lt" | "$lte" | "$gt" | "$gte" | "$ne" | "$eq" => {
            translate_operator(value_oper.operator.as_str())
        }
        "$regex" => "~",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…