distinctCount previously routed through getNumericField, so it silently returned 0 for
string/categorical fields — its primary use case (distinct categories / users / tags).
It now tracks the raw value (any type, keyed by string form) on both the add and remove
contribution paths; numeric ops (sum/avg/min/max/stddev/variance/percentile) are unchanged.
Also adds regression coverage confirming two long-standing query behaviors hold on the 8.0
engine: find({ where: { field: { missing: true } } }) matches a never-registered field, and
find({ type: [...], orderBy, limit }) returns the full set on the first call after
mutate+query+get. (percentile/median were already correct.)
Tests: tests/unit/brainy/find-agg-edge-cases.test.ts + existing aggregation suite green.
|
||
|---|---|---|
| .. | ||
| add.test.ts | ||
| batch-operations.test.ts | ||
| counts-by-type-fix.test.ts | ||
| fill-subtypes.test.ts | ||
| find-agg-edge-cases.test.ts | ||
| find.test.ts | ||
| get.test.ts | ||
| hybrid-search.test.ts | ||
| relate-duplicate-optimization.test.ts | ||
| relate.test.ts | ||
| update-reserved-metadata-remap.test.ts | ||
| update.test.ts | ||
| visibility.test.ts | ||