dittosynckit / live.ditto / DittoWriteTransactionPendingCursorOperation

DittoWriteTransactionPendingCursorOperation

class DittoWriteTransactionPendingCursorOperation

These objects are returned when using findByID functionality on DittoScopedWriteTransactions. You can use them to perform updates on a document and remove or evict a document.

Properties

collectionName

the name of the collection that the operation will be performed on.

val collectionName: String

dittoHandle

val dittoHandle: SWIGTYPE_p_Ditto

limit

var limit: Int

objectMapper

val objectMapper: ObjectMapper

objectReader

val objectReader: ObjectReader

offset

var offset: Int

orderDefinitions

var orderDefinitions: MutableList<COrderDefinition_t>

query

the query to be used to find matching documents.

val query: String

writeTxn

val writeTxn: SWIGTYPE_p_CWriteTransaction

Functions

evict

Evict all documents that match the query generated by the preceding function chaining.

fun evict(): List<String>

limit

Limit the number of documents that get returned when querying a collection for matching documents.

fun limit(limit: Int): DittoWriteTransactionPendingCursorOperation

offset

Offset the resulting set of matching documents. This is useful if you aren't interested in the first N matching documents for one reason or another. For example, you might already have queried the collection and obtained the first 20 matching documents and so you might want to run the same query as you did previously but ignore the first 20 matching documents, and that is where you would use offset.

fun offset(offset: Int): DittoWriteTransactionPendingCursorOperation

remove

Remove all documents that match the query generated by the preceding function chaining.

fun remove(): List<String>

sort

Sort the documents that match the query provided in the preceding find-like function call.

fun sort(query: String, direction: DittoSortDirection): DittoWriteTransactionPendingCursorOperation

update

Update documents that match the query generated by the preceding function chaining.

fun update(closure: (List<DittoMutableDocument>) -> Unit): Map<String, List<DittoUpdateResult>>
fun update(updater: DittoMutableDocumentsUpdater): Map<String, List<DittoUpdateResult>>