Class WriteTransactionPendingCursorOperation

These objects are returned when using find-like functionality on Collection.

They allow chaining of further query-related functions to do things like add a limit to the number of documents you want returned or specify how you want the documents to be sorted and ordered.

You can call exec() on the cursor to get an array of documents or you can use methods for updating, removing or evicting any matching documents.

Live queries and subscriptions are only available outside of transactions.

Not available in React Native environments.

Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption

Hierarchy (view full)

Properties

The collection the receiver is operating on.

Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption

query: string

The query the receiver is operating with.

Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption

queryArgs: QueryArguments

The named arguments for the query.

Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption

Methods

  • Offsets the resulting set of matching documents.

    This is useful if you aren't interested in the first N matching documents for one reason or another. For example, you might already have queried the collection and obtained the first 20 matching documents and so you might want to run the same query as you did previously but ignore the first 20 matching documents, and that is when you would use offset.

    Parameters

    • offset: number

      The number of matching documents that you want the eventual resulting set of matching documents to be offset by (and thus not include).

    Returns WriteTransactionPendingCursorOperation

    A cursor that you can chain further function calls and then either get the matching documents immediately or get updates about them over time.

    when called in a React Native environment.

    Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption

  • Sorts the documents that match the query provided in the preceding find-like function call.

    Documents that are missing the field to sort by will appear at the beginning of the results when sorting in ascending order.

    Parameters

    • propertyPath: string
    • Optionaldirection: SortDirection

      Specify whether you want the sorting order to be ascending or descending. Defaults to ascending.

    Returns WriteTransactionPendingCursorOperation

    A cursor that you can chain further function calls and then either get the matching documents immediately or get updates about them over time.

    when called in a React Native environment.

    Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption