public function aggregateGroup($group, $match = [], $query = null, $sort = null, $limit = null)
    {
        $query = $this->getDefault('query', $query);

        $collection = $this->dm->getDocumentCollection($this->document);

        $pipeline = [];

        if ($query) {
            $query = $this->addNativeQuery($this->queryFields, $query);
            $match = array_merge($match, $query);
        }


        if (count($match)) {
            $pipeline[] = [
                '$match' => $match
            ];
        }

        $pipeline[] = [
            '$group' => $group
        ];

        if ($sort) {
            $pipeline[] = [
                '$sort' => $sort
            ];
        }

        if ($limit) {
            $pipeline[] = [
                '$limit' => $limit
            ];
        }

        $return = $collection->aggregate($pipeline);

        return iterator_to_array($return);
    }