find

fun find(query: String): DittoWriteTransactionPendingCursorOperation

Generates a DittoWriteTransactionPendingCursorOperation with the provided query that can be used to update, remove, or evict documents.

Return

a DittoWriteTransactionPendingCursorOperation that you can use to chain further query-related function calls.

Parameters

query

the query to run against the collection.

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

Generates a DittoWriteTransactionPendingCursorOperation with the provided query that can be used to update, remove, or evict documents.

This is the recommended function to use when performing queries on a collection if you have any dynamic data included in the query string. It allows you to provide a query string with placeholders, in the form of $args.my_arg_name, along with an accompanying dictionary of arguments, in the form of { "my_arg_name": "some value" }, and the placeholders will be appropriately replaced by the matching provided arguments from the dictionary. This includes handling things like wrapping strings in quotation marks and arrays in square brackets, for example.

Return

a DittoWriteTransactionPendingCursorOperation that you can use to chain further query-related function calls.

Parameters

query

the query to run against the collection.

queryArgs

the arguments to use to replace placeholders in the provided query.