write

abstract suspend fun write(value: String)

Overwrites the document with value.

The write is atomic from the perspective of concurrent readers — they will observe either the previous or the new value, never a partial write.

Parameters

value

The content to persist. Pass an empty string to clear the document.

Throws

CancellationException

if the calling coroutine is cancelled before the write completes. Structured concurrency is respected — the exception propagates normally.