Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koolreport/mongodb
Allows you to connect and get data from MongoDB.
https://github.com/koolreport/mongodb
mongodb php-mongodb php-reporting-tools reporting-engine
Last synced: 5 days ago
JSON representation
Allows you to connect and get data from MongoDB.
- Host: GitHub
- URL: https://github.com/koolreport/mongodb
- Owner: koolreport
- Created: 2019-05-08T08:09:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T08:50:24.000Z (8 months ago)
- Last Synced: 2024-10-02T14:48:20.924Z (about 2 months ago)
- Topics: mongodb, php-mongodb, php-reporting-tools, reporting-engine
- Language: PHP
- Homepage: https://www.koolreport.com/
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Introduction
This package allows you to connect and get data from MongoDB.
# Installation
## By downloading .zip file
1. [Download](https://www.koolreport.com/packages/mongodb)
2. Unzip the zip file
3. Copy the folder `mongodb` into `koolreport` folder so that look like below```bash
koolreport
├── core
├── mongodb
```## By composer
```
composer require koolreport/mongodb
```# Documentation
### Settings
|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|### Example
```
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 [email protected]__.