This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves the full items referenced in the specified field of an item.
Reference and multi-reference fields refer to items in different collections. Use this method to retrieve the full details of the referenced items.
For example, suppose you have a Movies collection with an Actors field that contains references to items in a People collection. Querying the Movies collection using queryReferenced()
retrieves the relevant People items referenced in the Actors field of the specified Movie item. This gives you information from the People collection about each of the actors in the specified movie.
The queryReferenced()
method returns a Promise that resolves to the full items referenced in the specified property of the item from the specified collection. The Promise is rejected if the current user does not have read permissions for the specified collection or the collection containing the referenced items.
Notes:
queryReferenced()
for multi-reference fields.queryReferenced()
immediately following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set options.consistentRead
to true
.Learn more about querying items that reference other items.
ID of the collection that contains the referring item.
Referring item or referring item's ID.
Field that contains the references to the referenced items.
Options for querying referenced data items.