egg-nedb
egg plugin for nedb
Last updated 8 months ago by wellfrog16 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install egg-nedb 
SYNC missed versions from official npm registry.

egg-nedb

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-nedb --save

Usage

// {app_root}/config/plugin.js
exports.nedb = {
  enable: true,
  package: 'egg-nedb',
};

Configuration

// {app_root}/config/config.default.js
exports.nedb = {
  client: {
    // nedb的文件夹路径,nedb文件为*.db
    path: path.join(process.cwd(), '../nedb'),
  },
};

see config/config.default.js for more detail.

Example

// 直接文件
const db = app.nedb['account'];
const doc = await db.findOne({ username: username });

// 文件夹下文件访问
const db = app.nedb['security/account'];
const doc = await db.findOne({ _id: id });

语法参考 nedb-promises

Questions & Suggestions

Please open an issue here.

License

MIT

Current Tags

  • 0.1.1                                ...           latest (8 months ago)

2 Versions

  • 0.1.1                                ...           8 months ago
  • 0.1.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |