This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Includes referenced items for the specified fields.
The include()
method refines a search so that the items returned in the search results include the full referenced items for the specified fields.
For example, suppose you have a books collection with an author field that references an authors collection. Searching the books collection with an include("author")
returns the relevant book items, and each item includes the full referenced author item in the book's author
field.
When searching a collection that contains a reference field without using the include()
method:
When including a field with multiple references, the following limitations apply:
limit()
method.partialIncludes
field of the returned WixDataResult
is true
.Note: The include()
method is not supported for single-item collections.
Fields for which to include referenced items.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.