node db wat
mongo-like interface to rethinkdb
goals
- small efficient codebase
- high throughput atomic writes to disc/network (only write new data to disc)
- no write corruption on master data even during unexpected errors/faults.
- optional automatic passthrough to replicate or loadbalance
install
install https://rethinkdb.com/
npm install nodedbwat
check test.js
todo
many many things.
usage:
// LOAD/CREATE DATABASE(S)var nodedbwat = ;var db = nodedbwat; // SUBSCRIBE TO DB INSERT EVENTS FOR A REALTIME FEEDdbmydb; // INSERTS DATAdbmydb;
build:
tsc *.ts --lib 'ES2015' -w
reference
// CONNECTvar nodeDBwat = ;var db = nodeDBwat /*connect(peerIps[], collections[], options?) options = { dbPath: "./db" , // set the folder relative of abolute // use __dirname to get the current path}*/
// INSERT DATAvar somedata = foo : "bar" beep : "boop" a : 123 dbmydb
// FIND DATA BY FILTERINGdbmydb
// FIND AND UPDATE dbmydb
// SAVE TO db_mydb.json FILEdbmydb