Document
class Document(val key: Document.Key, options: Document.Options = Options(), dispatcher: CoroutineDispatcher = createSingleThreadDispatcher("Document($key)")) : Closeable
A CRDT-based data type. We can represent the model of the application and edit it even while offline.
A single-threaded, Closeable is used as default. Therefore you need to close the document, when the document is no longer needed. If you provide your own dispatcher, it is up to you to decide close is needed or not.
Constructors
Link copied to clipboard
constructor(key: Document.Key, options: Document.Options = Options(), dispatcher: CoroutineDispatcher = createSingleThreadDispatcher("Document($key)"))
Types
Properties
Functions
Link copied to clipboard
Subscribes to events on the document with the specific targetPath.
Link copied to clipboard
Deletes elements that were removed before the given time.
Link copied to clipboard
Link copied to clipboard
Returns the JsonElement corresponding to the path.
Link copied to clipboard
fun updateAsync(message: String? = null, updater: suspend (root: JsonObject, presence: Presence) -> Unit): Deferred<Boolean>
Executes the given updater to update this document.