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 = var db = reduxdbdbdbdb // using default index `_id` db dbusersdbusersid // 1234
API
reduxdb
- use(name)
reduxdb.DB
-
createCollection(name, options)
options
can be only used to define index, for exampledb.createCollection("user", {index: "uid"})
reduxdb.Collection
-
Only support Query for Equality, for example
// Return all users matching {"age": 18, "name": {"first": "Andrew"}} db.user.find({"age": 18, "name.first": "Andrew"})
-
Same
query
type asfind()
. -
getDB()
-
getFullName()
-
getIndexKeys()
-
getName()
-
No
options
supported here. -
Same
query
type asfind()
. -
update(query, update, options)
Same
query
type asfind()
.upsert
andmulti
are supported inoptions
.