Update

class Update(oldDocuments: List<DittoDocument>, insertions: List<Int>, deletions: List<Int>, updates: List<Int>, moves: List<DittoLiveQueryMove>) : DittoLiveQueryEvent

Provides information about the changes that have occurred in relation to a live query for a given update event.

This type is used every time a live query update is delivered after the initial event.

Constructors

Update
Link copied to clipboard
fun Update(oldDocuments: List<DittoDocument>, insertions: List<Int>, deletions: List<Int>, updates: List<Int>, moves: List<DittoLiveQueryMove>)

Functions

hash
Link copied to clipboard
fun hash(documents: List<DittoDocument>): BigInteger

Returns a hash that represents the set of matching documents.

hashMnemonic
Link copied to clipboard
fun hashMnemonic(documents: List<DittoDocument>): String

Returns a pattern of words that together create a mnemonic, which represents the set of matching documents.

Properties

deletions
Link copied to clipboard
val deletions: List<Int>

A list of the indexes in the list of old matching documents at which previously matching documents have been removed.

insertions
Link copied to clipboard
val insertions: List<Int>

A list of the indexes in the list of new matching documents at which new matching documents have been inserted.

moves
Link copied to clipboard
val moves: List<DittoLiveQueryMove>

A list of the tuples that provides the indexes, in relation to the list of old matching documents, that already matching documents have moved from and the indexes, in relation to the list of new matching documents, that the documents have moved to.

oldDocuments
Link copied to clipboard
val oldDocuments: List<DittoDocument>

A list of all of the documents that matched the live query as part of the previous update.

updates
Link copied to clipboard
val updates: List<Int>

A list of the indexes in the list of new matching documents at which already matching documents have been updated.