Ditto JS SDK v5.0.0
    Preparing search index...

    Class QueryResult<T>

    Represents results returned when executing a DQL query containing a QueryResultItem for each match.

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

    Type Parameters

    • T = any

      The type of items in the query result.

    Index

    Properties

    Accessors

    Methods

    Properties

    items: QueryResultItem<T>[]

    Individual items matching a DQL query.

    Accessors

    • get commitID(): bigint

      The commit ID associated with this query result, if any.

      This ID uniquely identifies the commit in which this change was accepted into the local store. The commit ID is available for all query results involving insertions, updates, or deletions. This ID can be used to track whether a local change has been synced to other peers.

      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.

      Returns bigint

    Methods

    • IDs of documents that were mutated locally by a mutating DQL query passed to execute(). Empty array if no documents have been mutated.

      **Note: Query results received from a StoreObserver never contain mutated document IDs because a store observer is always registered using a non-mutating SELECT query.

      /** IDs of documents that were mutated locally by a mutating DQL query passed to execute(). Empty array if no documents have been mutated.

      **Note: Query results received from a StoreObserver never contain mutated document IDs because a store observer is always registered using a non-mutating SELECT query.

      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.

      Returns any[]

      an array of document ID values as JSON-compatible values