koolreport / mongodb
Allow KoolReport to work with MongoDB
Installs: 1 211
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- mongodb/mongodb: ^1.4
This package is auto-updated.
Last update: 2024-10-28 10:04:38 UTC
README
This package allows you to connect and get data from MongoDB.
Installation
By downloading .zip file
- Download
- Unzip the zip file
- Copy the folder
mongodb
intokoolreport
folder so that look like below
koolreport ├── core ├── mongodb
By composer
composer require koolreport/mongodb
Documentation
Settings
Example
<?php
class MyReport extends \koolreport\KoolReport
{
public function settings()
{
return array(
"dataSources"=>array(
"mongo_purchase"=>array(
"class"=>'\koolreport\mongodb\MongoDataSource',
"connectionString"=>"mongo://johndoe:secret_password@localhost:65432",
"database"=>"dbpurchase"
),
)
);
}
public function setup()
{
$this->src('mongo_purchase')
->query(array(
'collection' => 'cPurchases',
'find' => ['age' => ['$gte' => '40']],
'options' => [
'skip' => 0,
'limit' => 5,
'projection' => [
'_id' => 0,
'name' => 1,
'age' => 1,
],
],
))
->pipe(..)
->pipe(...)
...
->pipe($this->dataStore('mongo_purchases'));
}
}
Support
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.