Skip to content

Move $collStats logic to its stage implementation #2423

Open
@AlekSi

Description

What should be done?

$collStats created the whole parallel universe for itself not only in the Stage interface but also in the aggregate command implementation. Could we fold that special case in the general design?

At the moment, the complexity is around $collStats does not always need to query database, and if does it uses its specific query to fetch data. There are other stages that does not query database such as $documents and $listSessions.

The proposed design separates Stages to ProducerStage and ProcessorStage (see #3102), each ProducerStage may decide how to produce document iterator.

Where?

https://github.com/FerretDB/FerretDB/blob/main/internal/handlers/pg/msg_aggregate.go
Also find issue link in the code base

Definition of Done

Metadata

Assignees

No one assigned

    Labels

    area/aggregationsIssues about aggregation pipelinesarea/diagIssues about diagnostic commandscode/choreCode maintenance improvementsnot readyIssues that are not ready to be worked on; PRs that should skip CI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions