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

Function count_distinct

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

Source from the content-addressed store, hash-verified

489
490 #[test]
491 fn count_distinct() {
492 let d1 = encode(&json!({"v": "a"}));
493 let d2 = encode(&json!({"v": "b"}));
494 let d3 = encode(&json!({"v": "a"}));
495 let docs: Vec<&[u8]> = vec![&d1, &d2, &d3];
496 assert_eq!(
497 compute_aggregate_binary("count_distinct", "v", None, &docs),
498 Value::Integer(2)
499 );
500 }
501
502 #[test]
503 fn string_agg() {

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected