Documents

interface Documents

Functions

Link copied to clipboard
abstract suspend fun create(uniqueName: String? = null, ttl: <Error class: unknown class> = Duration.INFINITE): SyncDocument

Create new SyncDocument object.

Link copied to clipboard
abstract suspend fun mutateDocument(sidOrUniqueName: String, mutator: suspend (<Error class: unknown class>) -> <Error class: unknown class>?): <Error class: unknown class>

Mutate value of the SyncDocument without opening it using provided Mutator function.

Link copied to clipboard
inline suspend fun <T : Any> Documents.mutateDocument(sidOrUniqueName: String, crossinline mutator: suspend (currentData: T) -> T?): T

Serializes the value returned by Mutator function into an equivalent JsonObject using a serializer retrieved from reified type parameter and uses the JsonObject to mutate value of the SyncDocument without opening the document.

Link copied to clipboard
abstract suspend fun mutateDocumentWithTtl(sidOrUniqueName: String, ttl: <Error class: unknown class>, mutator: suspend (<Error class: unknown class>) -> <Error class: unknown class>?): <Error class: unknown class>

Mutate value of the SyncDocument without opening it using provided Mutator function.

Link copied to clipboard
inline suspend fun <T> Documents.mutateDocumentWithTtl(sidOrUniqueName: String, ttl: <Error class: unknown class>, crossinline mutator: suspend (currentData: T) -> T?): T

Serializes the value returned by Mutator function into an equivalent JsonObject using a serializer retrieved from reified type parameter and uses the JsonObject to mutate value of the SyncDocument without opening the document.

Link copied to clipboard
abstract suspend fun openExisting(sidOrUniqueName: String): SyncDocument

Open existing SyncDocument by SID or unique name.

Link copied to clipboard
abstract suspend fun openOrCreate(uniqueName: String, ttl: <Error class: unknown class> = Duration.INFINITE): SyncDocument

Open existing SyncDocument by unique name or create a new one if specified name does not exist.

Link copied to clipboard
abstract suspend fun remove(sidOrUniqueName: String)

Remove SyncDocument without opening it.

Link copied to clipboard
abstract suspend fun setTtl(sidOrUniqueName: String, ttl: <Error class: unknown class>)

Set time to live for SyncDocument without opening it.

Link copied to clipboard
abstract suspend fun updateDocument(sidOrUniqueName: String, data: <Error class: unknown class>)

Set value of the SyncDocument as a JSON object without opening it.

Link copied to clipboard
inline suspend fun <T : Any> Documents.updateDocument(sidOrUniqueName: String, data: T)

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and set it as value of the SyncDocument without opening the document.

Link copied to clipboard
abstract suspend fun updateDocumentWithTtl(sidOrUniqueName: String, data: <Error class: unknown class>, ttl: <Error class: unknown class>)

Set value of the SyncDocument as a JSON object without opening it.

Link copied to clipboard
inline suspend fun <T : Any> Documents.updateDocumentWithTtl(sidOrUniqueName: String, data: T, ttl: <Error class: unknown class>)

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and set it as value of the SyncDocument without opening the document.