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

Function avg

nodedb-query/src/msgpack_scan/aggregate.rs:457–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

455
456 #[test]
457 fn avg() {
458 let d1 = encode(&json!({"v": 10}));
459 let d2 = encode(&json!({"v": 20}));
460 let docs: Vec<&[u8]> = vec![&d1, &d2];
461 assert_eq!(
462 compute_aggregate_binary("avg", "v", None, &docs),
463 Value::Float(15.0)
464 );
465 }
466
467 #[test]
468 fn avg_empty() {

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected