Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lmangani/rethinkdb-bulk

Queue & Bulk Operations for RethinkDB, and a name that stutters
https://github.com/lmangani/rethinkdb-bulk

bulk insert nosql queue rethink rethinkdb

Last synced: 21 days ago
JSON representation

Queue & Bulk Operations for RethinkDB, and a name that stutters

Awesome Lists containing this project

README

        

# RethinkDB-Bulk
Simple Bulk Operations for [RethinkDB](https://github.com/rethinkdb/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() });
```