zuper-stream
v2.0.8
Published
``` npm i zuper-stream ```
Downloads
18
Readme
Installation
npm i zuper-stream
Usage
Initialize Zuper Stream
const ZuperStream = require('zuper-stream');
Monitor MySQL Events and Publish to Kakfa
const company_ids = [1,2 ........n];
const mysqlStreamOptions = {
streamName: 'MYSQL_STREAM',
db: 'zuper_pro',
tables: ['users', 'companies'],
column: 'company_id',
column_ids: company_ids,
statements: 'ALL'
}
zuperStream.startMySQLStream(mysqlStreamOptions);
Monitor Mongo Events and Publish to Kakfa
const company_ids = [1,2 ........n];
const mongoStreamOptions = {
streamName: 'MONGO_STREAM',
db: 'zuper_service',
collection: 'jobs',
pipeline: [{ "$match": { "fullDocument.company_id": { "$in": company_ids } } }]
}
zuperStream.startMongoStream(mongoStreamOptions);