Query

Builds structured queries for data operations performed by DataManager. Supports filtering, sorting, grouping, paging, and other query transformations to retrieve and manipulate data from local or remote sources.

Methods

The following table outlines the methods for the Query:

NameParametersReturnsDescription
addParams
  • key

    : string
  • value

    : Function | string | null
  • Adds a custom parameter to be included in the request generated by DataManager. The parameter is stored internally and will be sent with the query during data operations.


    Params:
  • key: Specifies the name of the parameter.
  • value: Defines the value or function to compute the value for the parameter.
  • aggregate
  • type

    : string
  • field

    : string
  • Applies an aggregate operation to the specified field. Supported aggregate types include sum, avg, min, and max.


    Params:
  • type: Specifies the type of aggregation to perform.
  • field: Specifies the field name to apply the aggregation on.
  • page
  • pageIndex

    : number
  • pageSize

    : number
  • Applies pagination to the query using the specified page index and page size.


    Params:
  • pageIndex: Specifies the current page index to retrieve.
  • pageSize: Specifies the number of records to include per page.
  • requiresCount
    -

    Enables total record count retrieval in the query result. When set, the query result will include the total number of records matching the criteria.

    search
  • searchKey

    : string | number | boolean
  • fieldNames?

    : string | string[]
  • operator?

    : string
  • ignoreCase?

    : boolean
  • ignoreAccent?

    : boolean
  • Applies a search condition to the query using the specified key, fields, and operator. Supports case-insensitive and accent-insensitive search across one or more fields.


    Params:
  • searchKey: Specifies the value to search for.
  • fieldNames: Specifies one or more field names to apply the search on.
  • operator: Defines the comparison operator used for searching (e.g., contains, equal).
  • ignoreCase: Determines whether the search should ignore case sensitivity.
  • ignoreAccent: Determines whether the search should ignore accented characters.
  • select
  • fieldNames

    : string | string[]
  • Selects specific columns from the data source.


    Params:
  • fieldNames: Specifies one or more field names to include in the result.
  • skip
  • nos

    : number
  • Skips the specified number of records from the top of the data source.


    Params:
  • nos: Specifies the number of records to skip.
  • sortBy
  • fieldName

    : string | string[]
  • comparer?

    : string | Function
  • isFromGroup?

    : boolean
  • Sorts the data using the specified field(s) and sort direction or comparer. By default, the sort direction is ascending unless a custom comparer is provided.


    Params:
  • fieldName: Specifies one or more field names to sort by.
  • comparer: Defines the sort direction (ascending, descending) or a custom sort comparer function.
  • isFromGroup: Indicates whether the sort is triggered from a grouped query context.
  • sortByDesc
  • fieldName

    : string
  • Sorts the data in descending order based on the specified field.


    Params:
  • fieldName: Specifies the field name to apply descending sort.
  • take
  • nos

    : number
  • Limits the result set to the specified number of records from the top of the data source.


    Params:
  • nos: Specifies the number of records to retrieve.
  • where
  • fieldName

    : string | Predicate | Predicate[]
  • operator?

    : string
  • value?

    : ValueType | null
  • ignoreCase?

    : boolean
  • ignoreAccent?

    : boolean
  • matchCase?

    : boolean
  • Applies a filter condition to the query using the specified field, operator, and value. Supports case sensitivity, accent handling, and predicate chaining for advanced filtering.


    Params:
  • fieldName: Specifies the field name or a Predicate instance to apply the filter.
  • operator: Defines the comparison operator used for filtering (e.g., equal, contains, greaterThan).
  • value: Specifies the value to compare against the field.
  • ignoreCase: Determines whether the filter should ignore case sensitivity.
  • ignoreAccent: Determines whether the filter should ignore accented characters.
  • matchCase: Specifies whether the filter should enforce exact casing.