DittoScopedWriteTransaction

DittoScopedWriteTransaction exposes functionality that allows you to perform multiple operations on the store within a single write transaction.

  • The name of the collection that the scoped write transaction is scoped to.

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

    Throws

    DittoSwiftError.
  • Generates a DittoWriteTransactionPendingIDSpecificOperation with the provided document ID that can be used to update, remove, or evict the document.

    Throws

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

  • Generates a DittoWriteTransactionPendingCursorOperation with the provided query and query arguments 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.

  • Generates a DittoWriteTransactionPendingCursorOperation that can be used to update, remove or evict documents.