DittoCollection

A reference to a collection in a DittoStore.

Properties

Link copied to clipboard

the name of the collection.

Functions

Link copied to clipboard

Trigger an attachment to be downloaded locally to the device and observe its progress as it does so.

Link copied to clipboard

Generates a DittoPendingCursorOperation with the provided query that can be used to find the documents matching the query at a point in time or you can chain a call to observeLocal or subscribe if you want to get updates about documents matching the query as they occur.

fun find(query: String, queryArgs: Map<String, Any?>): DittoPendingCursorOperation

Generates a DittoPendingCursorOperation with the provided query that can be used to find the documents matching the query at a point in time or you can chain a call to observeLocal, subscribe if you want to get updates about documents matching the query as they occur.

Link copied to clipboard

Generates a DittoPendingCursorOperation that can be used to find all documents in the collection at a point in time or you can chain a call to observeLocal or subscribe if you want to get updates about documents in the collection over time.

Link copied to clipboard

Generates a DittoPendingIdSpecificOperation with the provided document identifier that can be used to find the document at a point in time or you can chain a call to observeLocal or subscribe if you want to get updates about the document over time.

Link copied to clipboard
fun newAttachment(inputStream: InputStream, metadata: Map<String, String> = emptyMap()): DittoAttachment?
fun newAttachment(path: String, metadata: Map<String, String> = emptyMap()): DittoAttachment?

Creates a new attachment, which can then be inserted into a document.

Link copied to clipboard
fun <T : Any> upsert(value: T, writeStrategy: DittoWriteStrategy = DittoWriteStrategy.Merge): DittoDocumentId

Inserts a new document into the collection and returns its identifier. If the document already exists, the behavior is determined by the given writeStrategy.