About Collections

Collections store data in a structured format, similar to tables in a relational database. They serve as the data foundation that powers datasets, dynamic pages, and API operations throughout the Wix Data ecosystem.

Each collection defines a structure of fields that determine what type of data the collection stores and how it's organized. However, this structure isn't enforced.

You can create multiple collections in your CMS to organize different types of content. For example, you can create separate collections for contact form submissions, real estate listings, and real estate agents.

You can manage collections using the Data API or through the CMS.

App collections

App collections are special collections that are automatically created when you add certain Wix apps to a site. These collections store the data from those apps and make it available through the same APIs and tools you use for custom collections. Many app collections restrict modifications to ensure data integrity, but you can still query and read their data.

In addition to using the generic data APIs to access app collections, you can also use the APIs provided by the specific app. For example, the Wix Stores API provides methods to work with the data in the Wix Stores app collections.

The editor hides app collections by default, but you can show them if needed.

App collections are useful for:

  • Creating custom displays of app data, such as unique product layouts.
  • Connecting app data with your custom collections, such as connecting blog posts with author profiles.
  • Building specialized search interfaces, such as advanced product filters.
  • Creating custom reports and analytics, such as member activity tracking.

Collection IDs

Every collection has a unique collection ID that serves as its identifier whenever you need to reference it in code. App collection IDs follow the pattern AppName/CollectionName.

For example, here Listings is a custom collection ID and Blog/Posts is an app collection ID:

Copy

Learn how to find a collection ID.

Permissions

Collections have configurable permissions that control who can read, create, update, and delete data. You can manage the permissions of collections that you create. App collections have fixed permissions that you can't change.

You can manage permissions using the Data Collections API or through the CMS.

Indexes

Indexes are database optimizations that improve query performance by creating organized maps of your collection data. They speed up searches, filters, and sorting operations.

There are 2 types of indexes:

  • Regular indexes: Improve query performance for frequently searched fields.
  • Unique indexes: Provide performance benefits and enforce data uniqueness.

You can manage indexes using the Data Indexes API or through the editor.

Automatic indexes

For large collections with high query volumes, Wix automatically identifies slow-running queries and creates indexes to improve performance. Automatic indexes are created behind the scenes to optimize data retrieval without any action required from you.

See also

Did this help?