aggregate
Compute counts, sums, averages, min/max, and grouped totals across records on the server, replacing manual paging and addition. Supports filters, linked records, and date bucketing.
Instructions
Count and total active records on the server instead of paging and adding by hand. Filters are the same as search_records (collection_id, where, filters, text, linked_to). metrics = [{op: count}] or [{op: sum|avg|min|max, field: [keys], type?}]; min/max accept type "string" for ISO dates. group_by = {field: [keys], bucket?: "month"|"year"} or {collection: true} or {linked: {relationship_types?, direction?}} (e.g. spend per vendor). ALWAYS read used, skipped_missing and skipped_non_numeric on each metric before quoting a total: a value stored as "95 LPA" or left blank is skipped, not counted as zero, so say how many records the figure leaves out. With linked grouping a record linked to several records counts in each group, so groups can sum to more than matched. Up to 100 groups, largest first; groups_truncated reports more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| limit | No | ||
| where | No | ||
| filters | No | ||
| metrics | No | ||
| group_by | No | ||
| linked_to | No | ||
| collection_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||