File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
website/src/pages/en/subgraphs/cookbook Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ Timeseries and aggregations reduce data processing overhead and accelerate queri
3636
3737## How to Implement Timeseries and Aggregations
3838
39+ ### Prerequisites
40+
41+ You need ` spec version 1.1.0 ` for this feature.
42+
3943### Defining Timeseries Entities
4044
4145A timeseries entity represents raw data points collected over time. It is defined with the ` @entity(timeseries: true) ` annotation. Key requirements:
@@ -51,7 +55,7 @@ Example:
5155type Data @entity (timeseries : true ) {
5256 id : Int8 !
5357 timestamp : Timestamp !
54- price : BigDecimal !
58+ amount : BigDecimal !
5559}
5660```
5761
@@ -68,11 +72,11 @@ Example:
6872type Stats @aggregation (intervals : ["hour" , " day" ], source : " Data" ) {
6973 id : Int8 !
7074 timestamp : Timestamp !
71- sum : BigDecimal ! @aggregate (fn : " sum" , arg : " price " )
75+ sum : BigDecimal ! @aggregate (fn : " sum" , arg : " amount " )
7276}
7377```
7478
75- In this example , Stats aggregates the price field from Data over hourly and daily intervals , computing the sum .
79+ In this example , Stats aggregates the amount field from Data over hourly and daily intervals , computing the sum .
7680
7781### Querying Aggregated Data
7882
You can’t perform that action at this time.
0 commit comments