Skip to main content

AggregateStore

Trait AggregateStore 

Source
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§

Source

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.

Source

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§

Source§

impl AggregateStore for MemoryEngine

Source§

impl AggregateStore for PersistentEngine

Available on crate feature persistent only.