var client = new MongoClient("<My connection string>");
var watchedDatabaseNames = new List<string> { "DB1", "DB2" };
var options = new ChangeStreamOptions { FullDocument = ChangeStreamFullDocumentOption.UpdateLookup };
var pipeline = new EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>()
.Match(change => watchedDatabaseNames.Contains(change.DatabaseNamespace.DatabaseName));
var cursor = client.Watch(pipeline, options);
Throws System.NotSupportedExceptions: 'Serializer for MongoDB.Driver.DatabaseNamespace 必须实现 IBsonDocumentSerializer 与 LINQ 一起使用'
在上面的最后一行。
我只是想收到变更流的通知,但仅限于某些数据库中的文档。 谁能帮帮我?