Interface LiveQueryParams

interface LiveQueryParams {
    args?: QueryArguments;
    collection: string;
    limit?: number;
    localOnly?: boolean;
    offset?: number;
    path?: string;
    query?: string;
    sort?: {
        direction?: SortDirection;
        propertyPath: string;
    };
}

Properties

args?: QueryArguments

Optional arguments that will interpolate the values into the query string. For example, if your query string is

"color == $args.color && mileage >= $args.mileage"
```. You can provide an args dictionary like:
```js
{ color: "red", mileage: "1200" }
collection: string
limit?: number

An optional number to limit the results of the query. If you omit this value, the query will return all values

localOnly?: boolean

When true the query will only on local data mutations and will not rely on replication.

offset?: number

An optional number to use as an offset of the results of the query. If you omit this value, an offset of 0 is assumed.

path?: string

The path of the Ditto string. If you omit this, it will fetch the first registered Ditto value.

query?: string

A Ditto query string. For more information on the query string syntax refer to https://docs.ditto.live/concepts/querying For example to query for a color property equal to red use: color == 'red'

sort?: {
    direction?: SortDirection;
    propertyPath: string;
}

Type declaration

  • Optional direction?: SortDirection
  • propertyPath: string

    An optional sort parameter for your query. For example, if you want to sort with ascending values on a specific field like "createdOn" use:

    {
    propertyPath: "createdOn",
    direction: "ascending"
    }

    For descending values use:

    {
    propertyPath: "createdOn",
    direction: "ascending"
    }

    For more information on the query string syntax refer to https://docs.ditto.live/concepts/querying