reduxdb
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

reduxdb

Redux with MongoDB-like API.

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 reduxdb

Usage

var reduxdb = require("reduxdb")
 
var db = reduxdb.use("test")
db.createCollection("users", {index: "id"})
db.createCollection("teams", {index: "id"})
db.createCollection("books")    // using default index `_id`
 
db.subscribe(function() {
    console.log(db.stats())
    console.log(db.users.stats())
    console.log(db.teams.stats())
    console.log(db.books.stats())
})
 
db.users.insert({id: "1234", name: "wizawu"})
db.users.findOne({name: "wizawu"}).id    // 1234

API

reduxdb

  • use(name)

reduxdb.DB

reduxdb.Collection

Readme

Keywords

none

Package Sidebar

Install

npm i reduxdb

Weekly Downloads

4

Version

3.1.0

License

none

Last publish

Collaborators

  • wizawu