Allow KoolReport to work with MongoDB

1.2.0 2019-08-26 09:54 UTC

This package is auto-updated.

Last update: 2021-11-07 12:14:13 UTC


This package allows you to connect and get data from MongoDB.


By downloading .zip file

  1. Download
  2. Unzip the zip file
  3. Copy the folder mongodb into koolreport folder so that look like below
├── core
├── mongodb

By composer

composer require koolreport/mongodb



Name type default description
class string Must set to '\koolreport\mongodb\MongoDataSource'
connectionString string Define connection string to MongoDB. If you use connectionString, you do not need to use properties host, username and password.
host string MongoDB host
username string Username
password string Password
database string The name of database you want to connect


class MyReport extends \koolreport\KoolReport
    public function settings()
        return array(
    public function setup()
            'collection' => 'cPurchases',
            'find' => ['age' => ['$gte' => '40']],
            'options' => [
                'skip' => 0,
                'limit' => 5,
                'projection' => [
                    '_id' => 0,
                    'name' => 1,
                    'age' => 1,


Please use our forum if you need support, by this way other people can benefit as well. If the support request need privacy, you may send email to us at support@koolreport.com.