pub trait AggregateStore {
// Required methods
fn aggregate(
&self,
collection: &str,
options: &AggregateOptions,
) -> ThingdResult<AggregateResult>;
fn timeseries(
&self,
collection: &str,
options: &TimeSeriesOptions,
) -> ThingdResult<TimeSeriesResult>;
}Expand description
Aggregation operations.
Required Methods§
Sourcefn aggregate(
&self,
collection: &str,
options: &AggregateOptions,
) -> ThingdResult<AggregateResult>
fn aggregate( &self, collection: &str, options: &AggregateOptions, ) -> ThingdResult<AggregateResult>
Run a general aggregation query over objects in a collection.
Supports count, sum, avg, min, max with optional group_by.
§Errors
Returns an error when the aggregation query fails.
Sourcefn timeseries(
&self,
collection: &str,
options: &TimeSeriesOptions,
) -> ThingdResult<TimeSeriesResult>
fn timeseries( &self, collection: &str, options: &TimeSeriesOptions, ) -> ThingdResult<TimeSeriesResult>
Run a time-bucketed aggregation query.
Groups objects by hour/day/week/month and applies an aggregation function.
§Errors
Returns an error when the time-series query fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl AggregateStore for MemoryEngine
impl AggregateStore for PersistentEngine
Available on crate feature
persistent only.