Registry / database / es-mongodb-sync

es-mongodb-sync

JSON →
library2.1.35jsnpmunverified

Node.js package that synchronizes MongoDB collections with Elasticsearch indices by tailing the MongoDB oplog. Supports one-to-one and one-to-many mappings, attachment sync, and filtering. Compatible with Elasticsearch 6.x and MongoDB 3.6+. Currently at version 2.1.35, with no recent updates. Requires a MongoDB replica set. Key differentiator: real-time sync via oplog tailing without additional middleware.

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CJS-only package; no default exports. Requires 'require'.

const MongoESConnector = require('es-mongodb-sync');

Initializes the MongoDB to Elasticsearch sync connector with Oplog tailing configuration.

const MongoESConnector = require('es-mongodb-sync'); const config = { mongodb: { m_database: 'myTest', m_collectionname: 'books', m_filterfilds: { version: '2.0' }, m_returnfilds: { bName: 1, bPrice: 1 }, m_extendfilds: { bA: 'extend A' }, m_connection: { m_servers: ['localhost:27017'], m_authentication: { username: 'UserAdmin', password: 'pass1234', authsource: 'admin', replicaset: 'my_replica', ssl: false } }, m_documentsinbatch: 5000, m_delaytime: 1000 }, elasticsearch: { e_index: 'mybooks', e_type: 'books', e_connection: { e_server: 'http://localhost:9200', e_httpauth: { username: 'EsAdmin', password: 'pass1234' } }, e_pipeline: 'mypipeline', e_iscontainattachment: false } }; MongoESConnector.initConn(config, function(err) { if (err) { console.error('Init error:', err); } else { console.log('Syncing started...'); } });
Debug
Known footguns
breakingRequires MongoDB replica set – standalone instances will not work.
deprecatedElasticsearch client version 6.x is used; not compatible with Elasticsearch 7+ (breaking changes in index/type mapping).
gotchaPackage is CJS-only and does not provide ESM exports; using import() will fail.
gotchaConfiguration file must be placed in a 'crawlerData' folder with a .json extension (not documented in all examples).
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
mj12bot
2
ahrefsbot
1
Resources