An open API service indexing awesome lists of open source software.

https://github.com/pythonzm/mongostream

跟踪mongo数据变化
https://github.com/pythonzm/mongostream

Last synced: 3 months ago
JSON representation

跟踪mongo数据变化

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

### 效果
![image](https://github.com/pythonzm/mongoStream/blob/master/screenshots/record.png)