level-stream-to-elasticsearch
v1.0.0
Published
LevelDB to Elasticsearch
Downloads
10
Maintainers
Readme
Migrate data from LevelDB to Elasticsearch the stream way
A writable stream wrapped elasticsearch index operation to bulk
Install
npm install level-stream-to-elasticsearch
Usage
// Create transform stream
var transformer = new Level2ESIndexTransformStream(opts);
transformer.on('end', function(){
console.log('finish');
});
// Prepare a ElasticsearchStreamIndex
var esi = new ElasticsearchStreamIndex(es, { highWaterMark: 2 });
esi.on('finish', function(){
console.log('esi finished');
});
// Pipe
levelDB.createReadStream().pipe(transformer).pipe(esi);