rethinkdb-bulk

1.0.3 • Public • Published

RethinkDB-Bulk

Simple Bulk Operations for RethinkDB

About

This simple module wraps a RethinkDB Client and Bulk/Queue Handler, automatically handling Database and Table creation and rotation using static, daily or monthly partitions.

Usage

Install

npm install rethinkdb-bulk

Init

The following configuration will create a Bulk Queue connected to RethinkDB (node or cluster)

const rethinkDBulk = require('rethinkdb-bulk').getBucket({
    config: { 
    "servers": [ 
        { "host": "127.0.0.1", "port": 28015 }
    }
    },
    dbName: 'myIndex',
    tableName: 'myTable',
    indexType: 'daily',
    bulk_timeout: 5000,
    bulk_maxSize: 1000,
    bulk_useInterval: true
});

Client

rethinkDBulk.push({ name: 'random1', value: 1111, created: new Date().toISOString() });
rethinkDBulk.push({ name: 'random2', value: 2222, created: new Date().toISOString() });
rethinkDBulk.push({ name: 'random3', value: 3333, created: new Date().toISOString() });

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    1

Package Sidebar

Install

npm i rethinkdb-bulk

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

7.72 kB

Total Files

5

Last publish

Collaborators

  • lmangani