1.1.4 ā€¢ Published 11 months ago

mongo-elastic-sync v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

mongo-elastic-sync

GitHub package.json version GitHub GitHub Workflow Status npm

šŸš€ Mongo-Elastic Sync is a Node.js library that provides synchronization between MongoDB and Elasticsearch. Seamlessly sync data changes between MongoDB collections and corresponding Elasticsearch indices.

Installation

npm install mongo-elastic-sync

Usage

const { Sync } = require("mongo-elastic-sync");

const mongoURL = "mongodb://localhost:27017";
const elasticURL = "http://localhost:9200";

const option = {
  prefix: "auto-sync-",
  initialSync: true,
  debug: false,
};

const syncInstance = new Sync(mongoURL, elasticURL, option);

// Initial Sync (Optional)
syncInstance.initialSync();

// Start Continuous Sync
syncInstance.startSync();

Configuration

  • mongoURL (string): MongoDB connection URL.
  • elasticURL (string): Elasticsearch connection URL.
  • option (object):
    • prefix (string, optional): Prefix for Elasticsearch indices. Default is "auto-sync-".
    • initialSync (boolean, optional): Perform an initial sync of existing MongoDB data to Elasticsearch. Default is true.
    • debug (boolean, optional): Enable debug mode for detailed logs. Default is false.

Features

  • šŸ”„ Initial Sync: Syncs existing MongoDB data to Elasticsearch upon initialization.
  • šŸ” Continuous Sync: Listens for changes in MongoDB collections and updates corresponding Elasticsearch indices.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

Feel free to contribute, report issues, or request features on GitHub.

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

6 years ago