rethinkdb-store

0.8.0 • Public • Published

rethinkdb-store

A high level nodejs library for accessing rethinkdb data.

Install

$ npm install rethinkdb-store

Usage

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}) -> object
store.upsert({host, port, db, table, docs, resolver}) -> object
store.delete({host, port, db, table, id}) -> object

Selecting data

store.getById({host, port, db, table, id, fields}) -> object
store.getAll({host, port, db, table, fields}) -> object
store.getByIndex({host, port, db, table, index, value, page, size, fields}) -> object
store.sampleByIndex({host, port, db, table, index, value, sample, fields}) -> object
store.getByIndex({host, port, db, table, index, value, page, size, fields}) -> object
store.betweenByIndex({host, port, db, table, index, from, to, page, size, fields}) -> object

Package Sidebar

Install

npm i rethinkdb-store

Weekly Downloads

10

Version

0.8.0

License

ISC

Unpacked Size

8.63 kB

Total Files

6

Last publish

Collaborators

  • homuchen