0.8.0 • Published 7 years ago
rethinkdb-store v0.8.0
rethinkdb-store
A high level nodejs library for accessing rethinkdb data.
Install
$ npm install rethinkdb-storeUsage
const store = require('rethinkdb-store');
//Or config througth environment vars `RTK_HOST`, `RTK_PORT`, `RTK_DB`
store.setConfig({
host: 'localhost',
port: 28015,
db: 'test'
})Writing data
store.insert({host, port, db, table, docs}) -> objectstore.upsert({host, port, db, table, docs, resolver}) -> objectstore.delete({host, port, db, table, id}) -> objectSelecting data
store.getById({host, port, db, table, id, fields}) -> objectstore.getAll({host, port, db, table, fields}) -> objectstore.getByIndex({host, port, db, table, index, value, page, size, fields}) -> objectstore.sampleByIndex({host, port, db, table, index, value, sample, fields}) -> objectstore.getByIndex({host, port, db, table, index, value, page, size, fields}) -> objectstore.betweenByIndex({host, port, db, table, index, from, to, page, size, fields}) -> object