Adds a sort to a query, sorting by the specified properties in ascending order.
The ascending()
function refines a LabelsQueryBuilder
to sort in ascending order of
the specified properties. If you specify more than one property,
ascending()
sorts the results in ascending order by each property in the
order they are listed.
You can sort the following types:
"abc"
comes after "XYZ"
.If a property contains a number as a String, that value will be sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.
The properties used in the sort.
Supported properties:
_createdDate
_updatedDate
displayName
Adds a sort to a query, sorting by the specified properties in descending order.
The descending()
function refines a LabelsQueryBuilder
to sort in ascending order of
the specified properties. If you specify more than one property,
descending()
sorts the results in descending order by each property in the
order they are listed.
You can sort the following types:
"abc"
comes after "XYZ"
.If a property contains a number as a String, that value will be sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.
The properties used in the sort.
Supported properties:
_createdDate
_updatedDate
displayName
Returns the items that match the query.
The find()
function returns a Promise that resolves to the results found
by the query and some information about the results. The Promise is
rejected if find()
is called with incorrect permissions or if any of the
functions used to refine the query are invalid.
Note:
Only visitors with
Manage Contacts permissions
can query labels.
You can override the permissions by setting the suppressAuth
option to true
.
function find(options: AuthOptions): Promise<LabelsQueryResult>;
Authorization options.
const queryResults = contacts.queryLabels().find();