神刀安全网

ReduxDB – Redux with MongoDB API: Get Rid of Actions and Stores

reduxdb ReduxDB – Redux with MongoDB API: Get Rid of Actions and Stores

Notice that NOT all the features of MongoDB are implemented here, such as multi-index and query operators.

The purpose of reduxdb is to avoid writing almost the same actions and stores again and again in different projects.

Installation

npm install --save redux reduxdb

Usage

import reduxdb = require("reduxdb")  let db = reduxdb.use("mysite") db.createCollection("user", {index: "id"}) db.createCollection("team", {index: "id"}) db.createCollection("book")     // using default index `_id`  db.user.insert({id: "123", name: "wizawu"}) db.user.findOne({name: "wizawu"}).id    // "123"

API

Thismarkdown explains the differences with official API.

reduxdb

  • use(name)

reduxdb.DB

reduxdb.Collection

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » ReduxDB – Redux with MongoDB API: Get Rid of Actions and Stores

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮