Implement marshalling aggregation results into models

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None

      While queries will always return model instances, aggregation pipelines can't do so and will always return BSON::Document instance as per the documentation.

      If possible, the documentation should show how users can marshal these objects into models of their choosing so that results from an aggregation pipeline can be combined with business logic defined in models. As an example, Doctrine MongoDB ODM for PHP supports returning custom objects from aggregation pipelines: https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/aggregation-builder.html#hydration

              Assignee:
              Unassigned
              Reporter:
              Andreas Braun
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: