DittoQueryResult

public class DittoQueryResult

Represents the result of executing a DQL query.

Note

More info such as metrics will be provided in the near future.

  • Individual items matching a DQL query.

    Declaration

    Swift

    public let items: [DittoQueryResultItem]
  • IDs of documents that were mutated locally by a mutating DQL query passed to execute(). Empty array if no documents have been mutated.

    Note

    A DittoStoreObserver can only be registered with a SELECT query, which is non-mutating, and thus the query result passed to the DittoStoreObservationHandler always returns an empty array in that case.

    Important: The returned document IDs are not cached. Make sure to call this method once and keep the return value for as long as needed.

    Declaration

    Swift

    public func mutatedDocumentIDs() -> [DittoDocumentID]
  • The commit ID associated with this query result, if any.

    This ID uniquely identifies the state of the local store after the query was executed. The commit ID is available for all query results that reflect committed data.

    For write transactions, the commit ID is only available after the transaction has been successfully committed. Queries executed within an uncommitted transaction will not have a commit ID.

    Declaration

    Swift

    public var commitID: UInt64? { get }