类 BaseChangeEvent<DocumentT>

  • 类型参数:
    DocumentT — 变更事件中完整文档的类型。

    公共抽象类BaseChangeEvent<DocumentT>扩展了对象
    表示此 SDK 中的监视流生成的所有 MongoDB Realm 更改事件中存在的属性集。其他事件类型会从此类型继承。
    • 方法详细信息

      • getOperationType

        public BaseChangeEvent.OperationType getOperationType()
        返回触发变更事件的变更的操作类型。
        返回:
        此更改事件的操作类型。
      • getFullDocument

        @Nullable public DocumentT getFullDocument()
        应用更改后某个时间点的完整文档。
        返回:
        完整文档。
      • getDocumentKey

        public BsonDocument getDocumentKey()
        实际更改的文档的唯一标识符。
        返回:
        文档键。
      • getUpdateDescription

        @Nullable public UpdateDescription getUpdateDescription()
        就更新而言,是指对添加、删除或更新字段的描述。
        返回:
        更新说明。
      • hasUncommittedWrites

        public boolean hasUncommittedWrites()
        表示尚未与远程数据存储同步的本地变更事件。 仅用于同步用例。
        返回:
        此更改事件是否表示未提交的写入。
      • toBsonDocument

        公共抽象BsonDocument toBsonDocument()
        将事件转换为 BSON 表示,就像在 MongoDB Realm change stream 或 Realm 紧凑监视流上一样。
        返回:
        变更事件的 BSON 文档表示形式。