{"id":16817141,"url":"https://github.com/rap2hpoutre/mongodb-elasticsearch-sync","last_synced_at":"2025-04-11T02:23:43.177Z","repository":{"id":66294555,"uuid":"384257088","full_name":"rap2hpoutre/mongodb-elasticsearch-sync","owner":"rap2hpoutre","description":"Copy data from MongoDB to Elasticsearch with a NodeJS CLI","archived":false,"fork":false,"pushed_at":"2021-07-09T14:41:21.000Z","size":50,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T23:51:23.459Z","etag":null,"topics":["cli","database","elasticsearch","hacktoberfest","javascript","mongodb","nodejs","synchronization"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rap2hpoutre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-08T21:57:03.000Z","updated_at":"2023-07-01T08:46:14.000Z","dependencies_parsed_at":"2023-04-14T07:54:18.121Z","dependency_job_id":null,"html_url":"https://github.com/rap2hpoutre/mongodb-elasticsearch-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fmongodb-elasticsearch-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fmongodb-elasticsearch-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fmongodb-elasticsearch-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fmongodb-elasticsearch-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rap2hpoutre","download_url":"https://codeload.github.com/rap2hpoutre/mongodb-elasticsearch-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328499,"owners_count":21085325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","database","elasticsearch","hacktoberfest","javascript","mongodb","nodejs","synchronization"],"created_at":"2024-10-13T10:46:19.125Z","updated_at":"2025-04-11T02:23:43.165Z","avatar_url":"https://github.com/rap2hpoutre.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"mongodb-elasticsearch-sync\n==========================\n\nSyncronize MongoDB and Elasticseach database. Copy and convert all data from a MongoDB database\nand index it in Elasticsearch.\n\n[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![Version](https://img.shields.io/npm/v/mongodb-elasticsearch-sync.svg)](https://npmjs.org/package/mongodb-elasticsearch-sync)\n[![License](https://img.shields.io/npm/l/mongodb-elasticsearch-sync.svg)](https://github.com/rap2hpoutre/mongodb-elasticsearch-sync/blob/main/package.json)\n\n## Usage\n\nRun this command by giving a MongoDB URI and Elasticsearch URI (no need to install first thanks to `npx`):\n\n```bash\nnpx mongodb-elasticsearch-sync \\\n  --mongodbUri=mongodb://localhost:27017/source \\\n  --elasticsearchUri=mongodb://localhost:27017/anonymized\n```\n\n☝️ Be careful, since Elasticsearch indexed will be reset.\n\n### Options\n\nUse `--singularizeName` to transform `users` collection in MongoDB into `user` in Elasticsearch.\n\n```bash\nnpx mongodb-elasticsearch-sync \\\n  --mongodbUri=mongodb://localhost:27017/source \\\n  --elasticsearchUri=mongodb://localhost:27017/anonymized\n  --singularizeName\n```\n## Why\n\nI recently created a [tool](https://github.com/rap2hpoutre/mongodb-anonymizer#mongodb-anonymizer)\nto anonymize MongoDB database (from a source db to a target db) to help me build a staging \nenvironment for a project. Since I use MongoDB with Elasticsearch for this project, I needed a\none-line command to create the Elascticsearch indices after this process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frap2hpoutre%2Fmongodb-elasticsearch-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frap2hpoutre%2Fmongodb-elasticsearch-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frap2hpoutre%2Fmongodb-elasticsearch-sync/lists"}