https://github.com/pythonzm/mongostream
跟踪mongo数据变化
https://github.com/pythonzm/mongostream
Last synced: 3 months ago
JSON representation
跟踪mongo数据变化
- Host: GitHub
- URL: https://github.com/pythonzm/mongostream
- Owner: pythonzm
- License: apache-2.0
- Created: 2021-11-05T07:39:26.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-06T10:52:01.000Z (over 3 years ago)
- Last Synced: 2025-01-08T18:49:56.910Z (5 months ago)
- Language: Go
- Size: 65.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mongoStream
跟踪mongo数据变化#### 使用前提:需要将源mongo库的数据同步至中间库一份
```bash
$ go mod
$ go build
$ mongoStream -h
Usage of mongoStream:
-data-mongo-uri string
which mongo to store the change history, default is src-mongo-uri (default "mongodb://localhost:27017")
-dbs string
which dbs to watch, as a comma separated list, default is all dbs (default "all")
-dest-coll string
which coll to store the change steam data (default "mongo")
-dest-db string
which db to store the change steam data (default "records")
-dest-mongo-uri string
which mongo to sync the data from src mongo,format: mongodb://user:pass@addr:port or mongodb://addr:port/?replicaSet=rs0 (default "mongodb://localhost:27017")
-src-mongo-uri string
which mongo to watch,format: mongodb://user:pass@addr:port or mongodb://addr:port/?replicaSet=rs0 (default "mongodb://localhost:27017")
```* -src-mongo-uri 指定数据源mongo
* -dest-mongo-uri 指定中间库
* -data-mongo-uri 指定存储变更数据的mongo### 效果
