This basic wrapper is designed to:
-
Leverage the power of reasondb
-
Handle and simplify complex cursor operations, including field filtering and metadata generation
-
Simplify query building
-
Add a little Syntactic sugar into the mix
Run [sudo] npm install reasondb-wrapper --save
'use strict'
const RDBWrapper = require('reasondb-wrapper')
const db = new RDBWrapper({
root: './db',
key: '@key',
clear: false,
active: true,
redis: {enabled: true, port: 6379, host: '127.0.0.1', detect_buffers: true},
async: true
})
'use strict'
const RDBWrapper = require('reasondb-wrapper')
const db = new RDBWrapper({
root: './db',
key: '@key',
clear: false,
active: true,
async: true
// store: RDBWrapper.JSONBlockStore // Should pull list from reasondb
})
class Person {
constructor (name, birthday) {
this.name = name
this.birthday = birthday
}
}
let person = new Person("Joe", new Date("1960-01-16"))
db.use(Person).post(person).then((response) => {
console.log(response)
})
class Person {
constructor (name, birthday) {
this.name = name
this.birthday = birthday
}
}
db.use(Person).get().then((response) => {
console.log(response) //JSON results with metadata
})
class Person {
constructor (name, birthday) {
this.name = name
this.birthday = birthday
}
}
db.use(Person).page(1).limit(20).fields({name: 1}).get().then((response) => {
console.log(response)
})
Connection configurationCreate DB directory and missing Primative directoriesCleans dataAbility to specify type of fallbackAbility to POST dataGET dataPaginate resultsSpecify fields to returnDELETE data- Metadata in results (part complete)
- Optional document schema for nested Reference documents
- Query builder (filter parameter)