Aggregate Records
This node performs database aggregations like Count, Sum, Min, Max, and Average.
The Aggregate Records node runs calculations on a collection of records on the server.
The Aggregate Records node allows you to compute statistics on your data without fetching all records to the client. It is efficient for dashboards and reports.
General
| Data | Description |
|---|
| Class | The database collection to aggregate. |
| Filter | Optional. A filter to select which records to include (same format as Filter Records). |
Aggregation
| Data | Description |
|---|
| Field | The field to aggregate on (e.g., "price"). |
| Operation | "Count", "Sum", "Min", "Max", "Average". |
| Group By | Optional. Field to group results by (e.g., "category"). |
Actions
| Signal | Description |
|---|
| Do | Triggers the aggregation. |
Outputs
Results
| Data | Description |
|---|
| Result | The calculated value (number). |
| Grouped Results | If "Group By" is used, an array of objects . |
Events
| Signal | Description |
|---|
| Done | Triggered when complete. |
Usage
Total Sales
- Class: "Orders".
- Field: "total".
- Operation: "Sum".
- Trigger Do.
- Result output will be the sum of all order totals.
Sales by Category
- Group By: "category".
- Grouped Results will contain .
Detailed Behavior
- Server-Side: The calculation happens in the database engine, minimizing data transfer.
Troubleshooting
- Zero Result: Ensure the field type is Number. Summing strings usually results in 0 or an error.