MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / extract_as_value

Function extract_as_value

nodedb-query/src/msgpack_scan/aggregate.rs:272–277  ·  view source on GitHub ↗

Extract a field as `Value`. Uses direct msgpack→Value for scalars; falls back to full decode only for complex types.

(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>)

Source from the content-addressed store, hash-verified

270/// Extract a field as `Value`. Uses direct msgpack→Value for scalars;
271/// falls back to full decode only for complex types.
272fn extract_as_value(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>) -> Option<Value> {
273 if let Some(expr) = expr {
274 return eval_expr_on_doc(doc, expr);
275 }
276 value_from_field(doc, field)
277}
278
279#[inline]
280fn value_from_field(doc: &[u8], field: &str) -> Option<Value> {

Callers 1

compute_aggregate_binaryFunction · 0.85

Calls 2

eval_expr_on_docFunction · 0.85
value_from_fieldFunction · 0.85

Tested by

no test coverage detected