Extension Config

To configure and customize your service plugin, you need to provide important details in the plugin.json configuration file.

Note

If you created your service plugin extension with the CLI, required fields are automatically populated for you.

Configuration Params
namespacestring

The namespace of the external database. This can be used to access collections within the database, for example namespace/collectionId.


uriConfigSpiBaseUri

The URI where the service provider is deployed.


Was this helpful?
Yes
No

queryReferencedDataItems( )

Important: This is a handler function. Implement it only as part of the service plugin.


Retrieves the items referenced in the specified field of a referring item. Reference fields refer to items that exist in different collections. Implement this function so callers can retrieve the full details of the referenced items.

This service plugin supports item multi-references, which means that data collections can have many-to-many relationships with other collections. For example, consider a scenario where a Movies collection includes a multi-reference Actors field, which might refer to several Actor items in an Actors collection. Users can therefore query the Movies collection to retrieve the Actor items referenced in each Movie item.

Notes:

  • This function does not retrieve the full referenced items of referenced items. For example, the referenced Actors collection might itself contain a multi-reference field with references to Award items in an Awards collection. When calling this function to retrieve the referenced items of any Movie item, the response contains the referenced Actor items, but only the IDs of the Award items. To retrieve the full Award items, the user must either call this function for the Actors collection, or the queryDataItems() function for the Awards collection.
  • This function might also be called when a user calls the isReferenced() function of the Data API.
Method Declaration
Copy
Method Parameters
payloadQueryReferencedDataItemsEnvelope
Returns
Return Type:QueryReferencedDataItemsResponse | Promise<QueryReferencedDataItemsResponse>
Was this helpful?
Yes
No