Page Contents

Home > @loopback/repository > includeRelatedModels

includeRelatedModels() function

Returns model instances that include related models that have a registered resolver.


export declare function includeRelatedModels<T extends Entity, Relations extends object = {}>(targetRepository: EntityCrudRepository<T, unknown, Relations>, entities: T[], include?: InclusionFilter[], options?: Options): Promise<(T & Relations)[]>;


Parameter Type Description
targetRepository EntityCrudRepository<T, unknown, Relations> The target repository where the model instances are found
entities T[] An array of entity instances or data
include InclusionFilter[] (Optional) Inclusion filter
options Options (Optional) Options for the operations


Promise<(T & Relations)[]>