jsreport extension adding support for storing report templates inside mongodb.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.eslintrc
.gitignore
.travis.yml
README.md
index.js
jsreport.config.js
package-lock.json
package.json

README.md

jsreport-mongodb-store

Build Status

jsreport extension adding support for storing templates and reports inside mongodb.

Installation

npm install jsreport-mongodb-store

Then alter jsreport configuration with:

{
  ....
  "store": {
    "provider": "mongodb",
  },
  "blobStorage": {
    "provider": "gridFS"
  },
  "extensions": {
    "mongodb-store": {
      "address": "127.0.0.1",
	    "databaseName" : "std"
    }
  }
}

Connection options can be passed as values of mongodb-store key in config too.

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

"store": {
  "provider": "mongodb"
},
"extensions": {
  "mongodb-store": {
    "uri": "mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test"
  }
}