Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

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() });

install

npm i rethinkdb-bulk

Downloadsweekly downloads

0

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar