cluster-memdb
A key-value memory database for single process application and cluster application.
Using this util, you can share datas in every processes of cluster.
installation
npm install cluster-memdb
usage
this example show you how to use it, you can read .d.ts
for more information
import {memdb, dbs} from 'cluster-memdb'
const userdb = memdb('user', 'id')
const lovedb = memdb('love', 'key')
await userdb.save([
{id:1, name:'Mike', gender:'male', love:['bread']},
{id:2, name:'Louis', gender:'female', love:['beef', 'bread']},
])
await lovedb.replace([
{key:'bread', price:'3.00'},
{key:'beef', price:'10.00'}
])
await dbs()
await userdb.getAll()
await lovedb.getByKeys(['bread'])
await userdb.find({name:'Mike'})
await userdb.delete([1, 2])
await love.clean()