Documentation ¶
Overview ¶
Package aggregations provides aggregation pipelines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPushdownQuery ¶ added in v0.9.4
GetPushdownQuery gets pushdown query for aggregation. When the first aggregation stage is $match, $match query is used for pushdown, otherwise nil is return.
func GetStatistics ¶ added in v1.0.0
GetStatistics has the same idea as GetPushdownQuery: it returns a list of statistics that need to be fetched from the DB, because they are needed for one or more stages.
Types ¶
type Accumulator ¶ added in v0.9.3
type Accumulator interface { // Accumulate documents and returns the result of applying accumulation operator. Accumulate(ctx context.Context, groupID any, in []*types.Document) (any, error) }
Accumulator is a common interface for accumulation.
type Stage ¶
type Stage interface { // Process applies an aggregate stage on `in` document, it could modify `in` in-place. Process(ctx context.Context, in []*types.Document) ([]*types.Document, error) // Type returns the type of the stage. Type() StageType }
Stage is a common interface for all aggregation stages. TODO use iterators instead of slices of documents https://github.com/FerretDB/FerretDB/issues/1889.
Click to show internal directories.
Click to hide internal directories.