Search.../

sort( )

Creates a sort to be used with the dataset setSort() function.

Description

This function is not used on its own. It is only used to create a sort for a dataset using the setSort() function.

When working with Wix app collections, check which fields can be used in a sort.

Syntax

function sort(): WixDataSort

sort Parameters

This function does not take any parameters.

Returns

A sort object.

Return Type:

Was this helpful?

Sort a dataset

Copy Code
1import wixData from 'wix-data';
2
3// ...
4
5$w("#myDataset").setSort( wixData.sort()
6 .ascending("lastName")
7 .descending("age")
8);