我正在寻找集合中单个文档“更新”操作的通知,据说当该特定文档更新时,MongoDB 会通知“监视”注册的 .net 客户端,但实际情况是 MongoDB 返回具有“更新”操作的所有文档集合,无论过滤器集的“匹配”条件如何。
有变革流经验的人可以提供帮助吗?这是 MongoDB 变更流的本质/设计吗?
下面是.net C#客户端的测试代码片段,
班上:
public class UserInfo
{
[BsonId, BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
[BsonElement("UserName", Order = 1), BsonRepresentation(BsonType.String)]
public string UserName { get; set; }
[BsonElement("Password", Order = 2), BsonRepresentation(BsonType.String)]
public string Password { get; set; }
[BsonElement("LastName", Order = 3), BsonRepresentation(BsonType.String)]
public string LastName { get; set; }
[BsonElement("FirstName", Order = 4), BsonRepresentation(BsonType.String)]
public string FirstName { get; set; }
[BsonElement("Email", Order = 5), BsonRepresentation(BsonType.String)]
public string …
Run Code Online (Sandbox Code Playgroud)