Egg rethinkdbdash plugin
$ npm i egg-rethinkdbdash --save
// {app_root}/config/plugin.js
exports.rethinkdbdash = {
enable: true,
package: 'egg-rethinkdbdash',
};
You need to put the rethinkdbdash config inside the client object.
// {app_root}/config/config.default.js
module.exports = appInfo => {
config.rethinkdbdash = {
client: {
host: 'localhost'
}
}
};
In controller, you can use this.app.rethinkdbdash to get the rethinkdbdash instance.
// app/controller/home.js
class HomeController extends Controller {
async index() {
const smashers = await this.app.rethinkdbdash.table('smashers').run();
this.ctx.body = smashers;
}
}
see rethinkdbdash for more detail.
Please open an issue here.