Skip to content

Allow flexible result mapping for aggregation pipelines #1900

Open
@alcaeus

Description

@alcaeus

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

When using aggregation pipelines in ODM, users can use QueryResultDocument objects to hydrate aggregation results into objects. However, when using more complex pipelines, this can quickly lead to issues. For example, api-platform/core#2144 (comment) shows using a facet pipeline stage to simultaneously fetch results and the count from a collection at the same time. However, this can only be done with arrays and a separate iterator because dynamically mapping the aggregation result to an object is not possible.

The idea is to create a system similar to ORM's ResultSetMapping that allows for more flexible and dynamic mapping of aggregation pipeline results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions