public function aggregate($collection, array $pipeline, $options = [])
    {
        $data = $this->dbConnection->selectCollection($collection)->aggregate($pipeline);
        if ($data['ok'] != 1) {
            throw new Exception("Tool Aggregation Error: ".$data['errmsg'], $data['code']);
        }

        return $data['result'];
    }