Expand description
Public helpers for streaming aggregate accumulators.
These thin wrappers expose field-extraction primitives used by the
handlers/aggregate.rs streaming accumulator path in the nodedb crate.
Each function operates on a single raw MessagePack document byte slice and
returns only the scalar value needed by the calling accumulator — no
document bytes are retained after the call returns.
Functions§
- extract_
bytes - Extract a field or expression result as raw msgpack bytes.
Used by
count_distinct,approx_count_distinct,approx_topk, etc. - extract_
f64 - Extract a numeric (f64) value from
field, or evaluateexprif provided. ReturnsNonewhen the field is absent or cannot be converted to f64. - extract_
non_ null - Returns
Some(())when the field is present and non-null. Used bycount(field)accumulator to count non-null values. - extract_
str - Extract a display string from
field, or evaluateexprif provided. ReturnsNonewhen the field is absent. - extract_
value - Extract a field as
Value. Uses direct msgpack→Value for scalars; falls back to full document decode only for complex types.