Expand description
Core value operations on nodedb_types::Value: comparison, coercion, truthiness.
Equivalent to json_ops.rs but operates on the internal Value type directly,
avoiding the serde_json::Value intermediate. Used by expression evaluation,
computed projections, and aggregate expression paths.
Functions§
- coerced_
eq - Check equality with type coercion.
- compare_
sort_ values - Order of two non-NULL values for an ORDER BY over output rows (window
ORDER BY, post-aggregate ORDER BY). Text orders by its bytes, so
"10"sorts before"9". Booleans sortfalsefirst. Any other pair takescompare_values: numbers by their exact reading, NaN above every number. The caller places NULLs. - compare_
values - Compare two Values with type coercion, for sorting and extremum selection (ORDER BY, MIN / MAX, GREATEST / LEAST, window frames).
- involves_
instant - Whether either side is a typed instant, so the pair compares by epoch
microseconds through
Value::partial_cmp_coerced(an ISO string on the other side is parsed). - is_
truthy - Check if a Value is truthy (for boolean contexts).
- numeric_
order - Numeric order of
aandbwhen both have a numeric reading (number, decimal, numeric string, bool).Nonewhen a side is not numeric. The order is total: NaN sorts above every number and equals NaN. - partial_
compare_ values - Compare two Values with type coercion, for a predicate.
- sort_
peers - Whether two values are peers under an ORDER BY: both NULL, or both
non-NULL and ordered
Equalbycompare_sort_values. NaN is a peer of NaN. - to_
value_ number - Convert an f64 to a Value, preferring integer representation.
- value_
to_ display_ string - Convert a Value to a display string.
- value_
to_ f64 - Coerce a Value to f64.