https://github.com/jsreport/jsreport-mongodb-store
jsreport extension adding support for storing report templates inside mongodb.
https://github.com/jsreport/jsreport-mongodb-store
Last synced: about 1 year ago
JSON representation
jsreport extension adding support for storing report templates inside mongodb.
- Host: GitHub
- URL: https://github.com/jsreport/jsreport-mongodb-store
- Owner: jsreport
- Created: 2015-10-08T15:42:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-08-20T16:49:03.000Z (almost 5 years ago)
- Last Synced: 2025-03-27T11:43:34.766Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://jsreport.net
- Size: 246 KB
- Stars: 8
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**⚠️ This repository has been moved to the monorepo [jsreport/jsreport](https://github.com/jsreport/jsreport)**
--
# jsreport-mongodb-store
[](https://travis-ci.org/jsreport/jsreport-mongodb-store)
[jsreport](http://jsreport.net/) extension adding support for storing templates and reports inside [mongodb](https://www.mongodb.org/).
## Installation
> npm install jsreport-mongodb-store
Then alter jsreport configuration with:
```js
{
....
"store": {
"provider": "mongodb",
},
"blobStorage": {
"provider": "gridFS"
},
"extensions": {
"mongodb-store": {
"address": "127.0.0.1",
"databaseName" : "std",
"connectOptions": { /* any custom mongodb connection options can be passed here */ },
"prefix": "jsreport_" // optional prefix for jsreport collections, defaults to no prefix
}
}
}
```
Connection options can be passed as values of `mongodb-store` key in config or as values inside the `connectOptions` key.
Note that both features are optional, you can use mongodb GridFS only for reports storage and fs-store (or any other store) for storing templates, also you can keep using file system storage for reports when required. In this case change `blobStorage` value to `fileSystem`.
You can also pass connection uri like this
```js
"store": {
"provider": "mongodb"
},
"extensions": {
"mongodb-store": {
"uri": "mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test"
}
}
```