find

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.

Return

a DittoPendingCursorOperation 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?>): 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.

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 DittoPendingCursorOperation 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.