rethinkdb-elasticsearch-stream
🔄 sync RethinkDB tables to Elasticsearch using changefeeds
![Greenkeeper badge](https://badges.greenkeeper.io/gsandf/rethinkdb-elasticsearch-stream.svg)
A JavaScript-based replacement for the deprecated Elasticsearch RethinkDB River plugin. This can populate your Elasticsearch instance using data from a RethinkDB instance, keep it up to date using changefeeds, and allow you to modify the documents before they're copied.
** ✨ Features: **
- Simple: specify connections and tables to copy as-is to Elasticsearch
- Flexible: accepts a transform function for each table to modify what's copied
- Tested
Usage
Simple example:
import rethinkdbElasticsearchStream from 'rethinkdb-elasticsearch-stream'
await rethinkdbElasticsearchStream({
backfill: true,
elasticsearch: { host: '127.0.0.1', port: 9200 },
rethinkdb: { host: '127.0.0.1', port: 28015 },
tables: [{ db: 'megacorp', table: 'users' }],
watch: true
});
Everything:
import rethinkdbElasticsearchStream from 'rethinkdb-elasticsearch-stream'
await rethinkdbElasticsearchStream({
backfill: true,
elasticsearch: { host: '127.0.0.1', port: 9200 },
rethinkdb: { host: '127.0.0.1', port: 28015 },
tables: [
{
db: 'megacorp',
idKey: 'id',
table: 'users',
transform: async ({ db, document, table }) => {
await doSomethingImportant()
return document
}
}
],
watch: true
});
Install
With npm installed, run
yarn add rethinkdb-elasticsearch-stream
npm install rethinkdb-elasticsearch-stream
See Also
rethinkdb-elasticsearch-stream was inspired by:
License
MIT