The WixDataQuery
functions enable you to run, sort, filter, and control
which results a query returns.
Typically, you build a query using the query()
function,
refine the query by chaining WixDataQuery
functions, and then execute the
query by chaining one of the following: find()
, distinct()
, or count()
For example, the following code queries a collection for all male customers over the age of 20 and logs the first 15 results to the console, sorted in ascending order by name:
When working with Wix app collections, fields in the collections have the following permissions: