pub enum FieldPred {
Show 16 variants
Eq(String, Value),
Ne(String, Value),
Gt(String, f64),
Gte(String, f64),
Lt(String, f64),
Lte(String, f64),
Contains(String, String),
StartsWith(String, String),
Exists(String, bool),
IsNull(String, bool),
In(String, Vec<Value>),
Nin(String, Vec<Value>),
EndsWith(String, String),
Id(String),
DatetimeComponent {
field: String,
which: u8,
value: i64,
},
Type(String, String),
}Expand description
A single-field predicate inside a where expression.
Variants§
Eq(String, Value)
$eq equality; $eq:null is an explicit alias for the is-null state predicate.
Ne(String, Value)
$ne inequality; the field must be present for the predicate to match.
Gt(String, f64)
$gt numeric/datetime strictly-greater comparison.
Gte(String, f64)
$gte numeric/datetime greater-than-or-equal comparison.
Lt(String, f64)
$lt numeric/datetime strictly-less comparison.
Lte(String, f64)
$lte numeric/datetime less-than-or-equal comparison.
Contains(String, String)
$contains case-insensitive substring match on a string.
StartsWith(String, String)
$startsWith case-insensitive prefix match on a string.
Exists(String, bool)
$exists presence test; the flag selects present (true) or absent.
IsNull(String, bool)
$isNull/$eq:null null-state test; the flag selects null (true) or non-null.
In(String, Vec<Value>)
$in membership against a set of literal values.
Nin(String, Vec<Value>)
$nin non-membership; the field must be present and match none of the values.
EndsWith(String, String)
$endsWith case-insensitive suffix match on a string.
Id(String)
$id — match the record identity itself.
DatetimeComponent
Datetime component predicate: { created: { $year: 2023 } }.
which = 0..6 (year/month/day/hour/minute/second/millisecond).
Fields
Type(String, String)
$type operator: “string” | “number” | “boolean” | “array” | “object”