reduxdb v3.1.0
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 reduxdbUsage
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 // 1234API
reduxdb
- use(name)
reduxdb.DB
createCollection(name, options)
optionscan be only used to define index, for exampledb.createCollection("user", {index: "uid"})- getCollectionNames()
- getName()
- stats()
- subscribe(listener)
reduxdb.Collection
- copyTo(newCollection)
- count()
- drop()
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
querytype asfind().getDB()
- getFullName()
- getIndexKeys()
- getName()
No
optionssupported here.Same
querytype asfind().- save(document)
- stats()
update(query, update, options)
Same
querytype asfind().upsertandmultiare supported inoptions.
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago