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

Function array_agg_distinct

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

Source from the content-addressed store, hash-verified

579
580 #[test]
581 fn array_agg_distinct() {
582 let d1 = encode(&json!({"v": 1}));
583 let d2 = encode(&json!({"v": 2}));
584 let d3 = encode(&json!({"v": 1}));
585 let docs: Vec<&[u8]> = vec![&d1, &d2, &d3];
586 let result = compute_aggregate_binary("array_agg_distinct", "v", None, &docs);
587 assert_eq!(
588 result,
589 Value::Array(vec![Value::Integer(1), Value::Integer(2),])
590 );
591 }
592
593 #[test]
594 fn sum_case_when_expression() {

Callers

nothing calls this directly

Calls 2

compute_aggregate_binaryFunction · 0.85
encodeFunction · 0.70

Tested by

no test coverage detected