Creates a query to retrieve a list of service
objects.
The queryServices()
function builds a query to retrieve a list of service
objects and returns a ServicesQueryBuilder
object.
The returned object contains the query definition, which is typically used to run the query using the find() function.
You can refine the query by chaining ServicesQueryBuilder
functions onto the query. ServicesQueryBuilder
functions enable you to sort, filter, and control the results that queryServices()
returns.
queryServices()
runs with the following ServicesQueryBuilder
defaults that you can override:
limit
is 100
.createdDate
in ascending order.The functions that are chained to queryServices()
are applied in the order they are called. For example, if you apply ascending("category.name")
and then ascending("name")
, the results are sorted first by category.name
, and then, if there are multiple results with the same category.name
, the items are sorted by name
.
The following ServicesQueryBuilder
functions are supported for the queryServices()
function. For a full description of the service
object, see the object returned for the items property in ServicesQueryResult
.
Query services without any filters. The defaults are a limit
of 100, and an offset
of 0.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.