Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
/ reduxdb Public archive

Redux with MongoDB-like API

License

Notifications You must be signed in to change notification settings

wizawu/reduxdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Redux with MongoDB-like API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published