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 properties in a query's results.
The include()
method refines a query so that the items returned in the
query's results include the full referenced items for the specified properties.
For example, suppose you have a books collection with an author
field that references an authors collection. Querying the books
collection with an include("author")
returns the relevant book items
and each item will include the full referenced author item in the book's
author
property.
When querying a collection that contains a reference field without using the
include()
method:
When including a property with multiple references, the following limitations apply:
limit()
method.partialIncludes
property of the returned WixDataQueryResult
is true
. To retrieve more than 50 referenced items, use the
queryReferenced()
method.For a discussion of when to use the similar queryReferenced()
method and when to use include()
, see Querying Items that Reference Other Items.
Note: The include()
method is not supported for single-item collections.
Fields for which to include referenced items.