Class BaseChangeEvent<DocumentT>

  • Type Parameters:
    DocumentT - The type of the full document in the change event.

    public abstract class BaseChangeEvent<DocumentT>
    extends Object
    Represents the set of properties that exist on all MongoDB realm change events produced by watch streams in this SDK. Other change event types inherit from this type.
    • Method Detail

      • getOperationType

        public BaseChangeEvent.OperationType getOperationType()
        Returns the operation type of the change that triggered the change event.
        Returns:
        the operation type of this change event.
      • getFullDocument

        @Nullable
        public DocumentT getFullDocument()
        The full document at some point after the change has been applied.
        Returns:
        the full document.
      • getDocumentKey

        public BsonDocument getDocumentKey()
        The unique identifier for the document that was actually changed.
        Returns:
        the document key.
      • getUpdateDescription

        @Nullable
        public UpdateDescription getUpdateDescription()
        In the case of an update, the description of which fields have been added, removed or updated.
        Returns:
        the update description.
      • hasUncommittedWrites

        public boolean hasUncommittedWrites()
        Indicates a local change event that has not yet been synchronized with a remote data store. Used only for the sync use case.
        Returns:
        whether or not this change event represents uncommitted writes.
      • toBsonDocument

        public abstract BsonDocument toBsonDocument()
        Converts the change event to a BSON representation, as it would look on a MongoDB realm change stream, or a Realm compact watch stream.
        Returns:
        The BSON document representation of the change event.