Skip to content

"Undefined index: result" - When calling Model aggregation methods #44

Closed
@jmshelby

Description

@jmshelby

When I try to call any of the Model's aggregate functions (static calls to count, min, max, sum ...) I get this error message from the Builder.

image

In this example I have a simple class called Characters extending your base model, and its empty (no specialization code). Here is the logged output of the results array from the call to collection->aggregate()

(
    [errmsg] => no such cmd: aggregate
    [bad cmd] => Array
        (
            [aggregate] => characters
            [pipeline] => Array
                (
                    [0] => Array
                        (
                            [$group] => Array
                                (
                                    [_id] => 
                                    [*] => Array
                                        (
                                            [$sum] => 1
                                        )

                                )

                        )

                )

        )

    [ok] => 0
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions