{"id":18888007,"url":"https://github.com/codex-team/mongodb-changes-notifier","last_synced_at":"2026-02-24T11:30:19.360Z","repository":{"id":47657821,"uuid":"382929627","full_name":"codex-team/mongodb-changes-notifier","owner":"codex-team","description":"With this tool you'll be able to be notified of any data changes in MongoDB","archived":false,"fork":false,"pushed_at":"2021-09-27T20:13:56.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T05:28:10.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codex-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-04T19:09:32.000Z","updated_at":"2021-09-27T20:13:59.000Z","dependencies_parsed_at":"2022-09-14T09:11:14.685Z","dependency_job_id":null,"html_url":"https://github.com/codex-team/mongodb-changes-notifier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fmongodb-changes-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fmongodb-changes-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fmongodb-changes-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fmongodb-changes-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/mongodb-changes-notifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859562,"owners_count":19708863,"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":[],"created_at":"2024-11-08T07:41:15.590Z","updated_at":"2026-02-24T11:30:19.324Z","avatar_url":"https://github.com/codex-team.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongodb-changes-notifier\n\nWith this tool you'll be able to be notified of any data changes in MongoDB.\nYou can select what collections you want to watch, what change event types you interested in and generate notifications with the provided template.\n\n## Features\n\n- Watching for changes in your data\n- Notification via Telegram Bot\n- Filtering by [Change event type](https://docs.mongodb.com/manual/reference/change-events/)\n- Watching for several collections at once\n- Template engine with funcs provided by [sprig](https://github.com/Masterminds/sprig)\n\n## Prerequirements\n\n- [MongoDB replica set](https://docs.mongodb.com/manual/tutorial/deploy-replica-set/)\n- [Webhook from CodeX notify bot](https://github.com/codex-bot/notify)\n\n## Usage\n\n1. Create `config.yml` file using example file [./config.sample.yml](./config.sample.yml)\n2. Run `./mongodb-changes-notifier` command. By default, it will use `config.yml` file from current directory, but you can provide your owm path via `-config` flag\n\n## TODO\n- [ ] Another notifications channels (Email, Slack, etc)\n- [ ] Watching for collections by regexp\n- [ ] Watching the entire deployment ([link](https://docs.mongodb.com/manual/changeStreams/#watch-collection-database-deployment))\n- [ ] Custom variables providing\n\n## Docker usage\nThis tool also available as Docker image on DockerHub.\n\nYou can use it in the way like it:\n\n```yaml\nversion: \"3.8\"\n\nservices:\n  app:\n    image: \"codexteamuser/mongodb-changes-notifier\"\n    volumes:\n      - ./config.yml:/config.yml:ro\n```\n\n## Example\n\n### Logging users registrations\n\n```yaml\n# MongoDB URI for connecting\n# See https://docs.mongodb.com/manual/reference/connection-string/\nmongodb_uri: \"mongodb://127.0.0.1:27017/retrospect?readPreference=primary\u0026replicaSet=rs0\"\n\n# List of watches config\n# Describe here what collections you want to watch and what send when event fires\nwatches:\n    # List of event types you want to watch.\n    # See https://docs.mongodb.com/manual/reference/change-events/\n  - event_types:\n      - insert\n    # List of collection names you want to watch\n    collections:\n      - users\n    # Notify hook from CodeX bot for sending notifications\n    # See https://github.com/codex-bot/notify\n    notify_hook: \"https://notify.bot.codex.so/u/O7BK8PA6\"\n\n    # Notification template. Renders via text/template module\n    template: |\n      New user registered! 🚀\n      ID:  {{ .fullDocument._id.Hex }}\n      Username: {{ .fullDocument.username }}\n```\n\nYou will receive the following notification when new user register:\n\n![example 1](imgs/example1.png)\n\n### Logging data updates\n\n```yaml\n# MongoDB URI for connecting\n# See https://docs.mongodb.com/manual/reference/connection-string/\nmongodb_uri: \"mongodb://127.0.0.1:27017/retrospect?readPreference=primary\u0026replicaSet=rs0\"\n\n# List of watches config\n# Describe here what collections you want to watch and what send when event fires\nwatches:\n    # List of event types you want to watch.\n    # See https://docs.mongodb.com/manual/reference/change-events/\n  - event_types:\n      - update\n    # List of collection names you want to watch\n    collections:\n      - persons\n    # Notify hook from CodeX bot for sending notifications\n    # See https://github.com/codex-bot/notify\n    notify_hook: \"https://notify.bot.codex.so/u/O7BK8PA6\"\n\n    # Notification template. Renders via text/template module\n    template: |\n      \u003cb\u003ePerson\u003c/b\u003e has been updated! 🆙\n      See on \u003ca href=\"https://admin.st-retrospect.dh-center.ru/persons/{{ printf \"%s%s\" \"Person:\" .documentKey._id.Hex | b64enc }}\"\u003ethis page\u003c/a\u003e\n\n      \u003cb\u003eUpdated fields:\u003c/b\u003e\n      {{ .updateDescription.updatedFields | toYaml | indent 2 }}\n      \u003cb\u003eDeleted fields:\u003c/b\u003e\n      {{ .updateDescription.removedFields | toYaml | indent 2 }}\n```\n\nYou will receive the following notification when someone changes data of the person:\n\n![example 2](imgs/example2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fmongodb-changes-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fmongodb-changes-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fmongodb-changes-notifier/lists"}