Skip to main content

evaluate_condition

Function evaluate_condition 

Source
pub fn evaluate_condition<'a>(
    expr: &str,
    data: impl IntoIterator<Item = (&'a String, &'a Value)>,
) -> bool
Available on crate feature expression only.
Expand description

Evaluate a boolean condition, returning false on missing fields.

This is the safe evaluation mode for scoring when conditions, alert triggers, and routing rules. If a field referenced in the expression is missing from data, returns false instead of returning an error.

Non-boolean results are coerced: non-zero integers are truthy, zero and errors are falsy.