Open selim5 opened 4 years ago
In order to add a filter to the type of changes to log, we can easily add a pipeline to the code like such
matchPipeline := bson.D{ { "$match", bson.D{ {"operationType", "insert"}, {"fullDocument.duration", bson.D{ {"$gt", 30}, }}, }, }, } episodesStream, err := episodesCollection.Watch(context.TODO(), mongo.Pipeline{matchPipeline})
https://developer.mongodb.com/quickstart/golang-change-streams
Reopened to remember we can add support for that
In order to add a filter to the type of changes to log, we can easily add a pipeline to the code like such
Ressource
https://developer.mongodb.com/quickstart/golang-change-streams