Type alias RealtimeEvent<T>

RealtimeEvent<T>: {
    data: T;
    date: Date;
    index?: number;
    initial: boolean;
    matchType: MatchType;
    operation: Operation;
}

An event for a real-time query.

Type Parameters

Type declaration

  • data: T

    the database entity this event was generated for, e.g. an entity that just entered or left the result set, or an array of entities, if this event type is an initial result

  • date: Date

    server-time from the instant at which the event was generated

  • Optional index?: number

    for sorting queries only: the position of the matching entity in the ordered result (-1 for non-matching entities)

  • initial: boolean

    a boolean value indicating whether this event reflects the matching status at query time (true) or a recent change data change (false)

  • matchType: MatchType

    indicates how the transmitted entity relates to the query result. Every event is delivered with one of the following match types:

    • 'match': the entity matches the query.
    • 'add': the entity entered the result set, i.e. it did not match before and is matching now.
    • 'change': the entity was updated, but remains a match
    • 'changeIndex' (for sorting queries only): the entity was updated and remains a match, but changed its position within the query result
    • 'remove': the entity was a match before, but is not matching any longer
  • operation: Operation

    the operation by which the entity was altered 'none' if unknown or not applicable

Generated using TypeDoc