Hi , im trying to connect the koolReport to the MongoDB but i'm facing some error
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in C:\xampp\htdocs\caas\dash\koolreport\packages\mongodb\vendor\mongodb\mongodb\src\Client.php:81 Stack trace: #0 C:\xampp\htdocs\caas\dash\koolreport\packages\mongodb\MongoDataSource.php(59): MongoDB\Client->__construct('mongodb://127.0...') #1 C:\xampp\htdocs\caas\dash\koolreport\core\DataSource.php(22): koolreport\mongodb\MongoDataSource->onInit() #2 C:\xampp\htdocs\caas\dash\koolreport\KoolReport.php(215): koolreport\core\DataSource->__construct(Array, Object(SalesByCustomer)) #3 C:\xampp\htdocs\caas\dash\SalesByCustomer.php(26): koolreport\KoolReport->src('mongo_purchase') #4 C:\xampp\htdocs\caas\dash\koolreport\KoolReport.php(39): SalesByCustomer->setup() #5 C:\xampp\htdocs\caas\dash\index.php(5): koolreport\KoolReport->__construct() #6 {main} thrown in C:\xampp\htdocs\caas\dash\koolreport\packages\mongodb\vendor\mongodb\mongodb\src\Client.php on line 81
And i'm new to this so i need some guidance to connecting the koolReport to the MongoDB ,
The Code as follows
<?php
// index.php: Just a bootstrap file
require_once "SalesByCustomer.php";
$salesByCustomer = new SalesByCustomer;
$salesByCustomer->run()->render();
<?php
// SalesByCustomer.php - Report setup file
require_once "koolreport/autoload.php";
use \koolreport\processes\Group;
use \koolreport\processes\Sort;
use \koolreport\processes\Limit;
use \koolreport\mongodb\MongoDataSource;
class SalesByCustomer extends \koolreport\KoolReport
{
public function settings()
{
return array(
"dataSources"=>array(
"mongo_purchase"=>array(
"class"=>'\koolreport\mongodb\MongoDataSource',
"connectionString"=>"mongodb://127.0.0.1:27017",
"database"=>"formioapp"
),
)
);
}
public function setup()
{
$this->src('mongo_purchase')
->query(array("collections"=>"forms"))
->pipe($this->dataStore('mongo_purchases'));
}
}
Hi , im trying to connect the koolReport to the MongoDB but i'm facing some error
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in C:\xampp\htdocs\caas\dash\koolreport\packages\mongodb\vendor\mongodb\mongodb\src\Client.php:81 Stack trace: #0 C:\xampp\htdocs\caas\dash\koolreport\packages\mongodb\MongoDataSource.php(59): MongoDB\Client->__construct('mongodb://127.0...') #1 C:\xampp\htdocs\caas\dash\koolreport\core\DataSource.php(22): koolreport\mongodb\MongoDataSource->onInit() #2 C:\xampp\htdocs\caas\dash\koolreport\KoolReport.php(215): koolreport\core\DataSource->__construct(Array, Object(SalesByCustomer)) #3 C:\xampp\htdocs\caas\dash\SalesByCustomer.php(26): koolreport\KoolReport->src('mongo_purchase') #4 C:\xampp\htdocs\caas\dash\koolreport\KoolReport.php(39): SalesByCustomer->setup() #5 C:\xampp\htdocs\caas\dash\index.php(5): koolreport\KoolReport->__construct() #6 {main} thrown in C:\xampp\htdocs\caas\dash\koolreport\packages\mongodb\vendor\mongodb\mongodb\src\Client.php on line 81
And i'm new to this so i need some guidance to connecting the koolReport to the MongoDB , The Code as follows