@mantlebee/ts-data
    Preparing search index...

    Type Alias QueryItemsPayload<TItem>

    Description of a query over a list of items, agnostic of the storage that runs it: every property is optional and is set only by who needs it (e.g. the extensions of a DataSource). A reader translates it into the actual request (SQL, OData, in-memory, ...).

    const payload: QueryItemsPayload<User> = {
    filters: {
    filters: [{ field: "age", operator: FilterOperators.greaterThan, value: 18 }],
    logic: FilterLogics.and,
    },
    pagination: { itemsPerPage: 20, page: 1, totalItemsCount: 0 },
    sorts: [{ asc: true, field: "lastName" }],
    };
    type QueryItemsPayload<TItem = Any> = {
        distinct?: boolean;
        filters?: FiltersExpression<TItem>;
        pagination?: Pagination;
        projections?: List<Projection<TItem>>;
        sorts?: List<Sort<TItem>>;
    }

    Type Parameters

    • TItem = Any

      Type of the items; the fields of filters, sorts and projections are its keys.

    Index
    distinct?: boolean

    true to drop the duplicated items of the result.

    Conditions the items must satisfy.

    pagination?: Pagination

    Page requested.

    projections?: List<Projection<TItem>>

    Fields to return; absent or empty means every field.

    sorts?: List<Sort<TItem>>

    Order of the items, by priority: the first sort wins.