Skip to main content

Module document_split_counts

Module document_split_counts 

Source
Expand description

FromProof + Fetch for [DocumentSplitCounts] — the per-group-entry view of the unified getDocuments endpoint.

Backed by the same DocumentQuery as [drive_proof_verifier::DocumentCount]; the only difference is response shape — DocumentSplitCounts returns the full entries list keyed by the splitting property’s serialized value, while DocumentCount returns the sum.

Per-shape proof dispatch lives in [super::count_proof_helpers::verify_count_query] — this impl passes the verified entries through unchanged.

Shapes emitted by verify_count_query:

  • group_by = [] (aggregate): one entry with empty key carrying the verified total. AggregateCountOnRange, primary-key CountTree, and point-lookup-on-Equal-only paths all collapse to this shape.
  • group_by = [in_field] (per-In entries): one entry per present queried In value, with count: Some(n). Absent In branches are omitted from entries — the current point-lookup path query doesn’t request absence proofs, so grovedb’s verify_query surfaces only present (path, key, Some(Element)) triples. Callers that need to distinguish “verified zero” from “queried but absent” diff their request’s In array against the returned entries by key (each entry’s key is serialize_value_for_key(in_field, v)).
  • group_by = [range_field] / [in_field, range_field] (distinct walk): one entry per distinct value in the range (compound queries: per (in_key, key) pair). Zero-count ranges are simply absent — the range itself is unbounded so there’s no enumerable key set to ever-emit.