Warning: Wix Data APIs currently require the site's code editor (Dev mode) to be enabled. For this reason, we recommend against using these APIs for building Wix CLI apps and self-hosted apps, as the apps may be installed on sites where Dev mode isn't enabled. For Headless development, you can use the APIs without any restrictions.
The Indexes API enables you to create indexes for data collections, to make querying data faster.
An index is a map of a collection's data, organized according to fields that you select. An index increases the speed of queries by providing a query with a shortcut to the information it's looking for. Instead of iterating through every data item in the collection, a query can use the index to skip to potentially relevant items. The larger a collection is, the more time this saves.
With the Indexes API, you can:
To learn about the differences between regular and unique indexes, see Index Types.
It's important to note the following points before starting to code:
$startsWith, aren't accelerated by an index.