Expand description
FromProof + Fetch for [DocumentAverage] — the single-row
aggregate (count, sum) view of the unified getDocuments
endpoint.
Callers build a DocumentQuery with
.with_select(Select::Avg) and .with_select_field("<prop>");
whatever the request shape, this impl returns a single
DocumentAverage { count, sum }. Per-shape proof dispatch lives
in [super::average_proof_helpers::verify_average_query] — this
impl folds the verified entries into a single pair.
Empty entries (a verifier that emitted None for a queried-but-
absent branch — same forward-compat for absence proofs as count)
contribute 0 to both axes via filter_map(|e| e.<field>).
A containsAny over several elements of a typed array is refused, even
grouped by the array: folded, a document holding two of the elements would
be counted and summed twice. DocumentSplitAverages keeps one pair per
element.