Skip to main content

Module json_ops

Module json_ops 

Source
Expand description

Shared JSON value operations: comparison, coercion, truthiness.

Used by both expression evaluation (computed projections) and scan filters (WHERE predicate evaluation). Pure functions on serde_json::Value.

Functions§

coerced_eq
Check equality with type coercion.
compare_json
Compare two JSON values with type coercion.
compare_json_numbers
Exact order of two JSON numbers. i64 and u64 pairs compare exactly, and an integer against a float compares without rounding. None when a side has no numeric reading.
compare_json_optional
Compare two optional JSON values (for scan_filter compatibility).
is_truthy
Check if a JSON value is truthy (for boolean contexts).
json_to_display_string
Convert a JSON value to a display string.
json_to_f64
Coerce a JSON value to f64.
numeric_order
Numeric order of a and b when both have a numeric reading (number, numeric string, bool). None when a side is not numeric. The order is total: NaN sorts above every number and equals NaN.
to_json_number
Convert a f64 to a JSON number, preferring integer representation.