attachDocument

fun attachDocument(document: Document, initialPresence: P = emptyMap(), syncMode: Client.SyncMode = SyncMode.Realtime, schema: String? = null, disableGC: Boolean = false, disablePresence: Boolean = false): Deferred<OperationResult>

Attaches the given Document to this Client. It tells the server that this Client will synchronize the given document.

Parameters

initialPresence

: is the initial presence of the client.

syncMode

: defines the synchronization mode of the document.

schema

: is the schema of the document. It is used to validate the document.

disableGC

: declares that this attachment will not produce or consume tombstones. The server skips minVV tracking and omits the response VersionVector for this client. Use only with Counter or primitive workloads where no client consumes tombstones; misuse on a document that uses Tree, Text, or Array deletions leads to undefined GC behavior on this client. Controls only the wire contract and is distinct from any local-only Document GC pass.

disablePresence

: declares that this document does not produce, consume, or store presence. When true, the initial presence is not pushed and presence updates from Document.updateAsync are dropped. Honored on first attach only; the server persists the value and returns it on subsequent attaches.