Defines a field name and the order type used to sort query results.
Description
The SortField class allows you to define a field used to sort query results. In addition, it allows you to specify the order type as ascending or descending.
Constructors
NewSortField
Creates a new instance and assigns its values.
NewSortField(name string, ascending bool) SortField
- name: string - the name of the field to sort by.
- ascending: bool - true to sort in ascending order, and false to sort in descending order.
NewEmptySortField
Creates a new empty instance.
NewEmptySortField() SortField
Fields
Examples
filter := NewFilterParamsFromTuples("type", "Type1")
paging := NewPagingParams(0, 100)
sorting := NewSortingParams(NewSortField("create_time", true))
err, page = myDataClient.GetDataByFilter(context.Background(), filter, paging, sorting)