egg-session-mongo
v2.0.2
Published
MongoDB store for egg session. based on `connect-mongo`.
Downloads
6
Maintainers
Readme
egg-session-mongo
A session extension for store session in MongoDB.
see Chinese version: 中文
Install
$ npm i egg-session-mongo --save
Usage
// {app_root}/config/plugin.js
exports.sessionMongo = {
enable: true,
package: 'egg-session-mongo',
};
or you can overwrite you MongoStore
options in app.js
.
// {app_root}/app.js
module.exports = app => {
const MongoStore = require('egg-session-mongo')(app);
app.beforeStart(async () => {
app.sessionStore = new MongStore(/* options */);
});
};
see app.js for more detail.
Configuration
// {app_root}/config/config.default.js
exports.sessionMongo = {
url: 'mongodb://127.0.0.1/test'
};
see config/config.example.js for more detail.
Questions & Suggestions
Please open an issue here. or open an issue just at this repo's issue for more timely reply