---
lang: en
title: 'API docs: repository.includerelatedmodels'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.includerelatedmodels.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [includeRelatedModels](./repository.includerelatedmodels.md)

## includeRelatedModels() function

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

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  targetRepository | [EntityCrudRepository](./repository.entitycrudrepository.md)<!-- -->&lt;T, unknown, Relations&gt; | The target repository where the model instances are found |
|  entities | T\[\] | An array of entity instances or data |
|  include | [InclusionFilter](./filter.inclusionfilter.md)<!-- -->\[\] | <i>(Optional)</i> Inclusion filter |
|  options | [Options](./repository.options.md) | <i>(Optional)</i> Options for the operations |

<b>Returns:</b>

Promise&lt;(T &amp; Relations)\[\]&gt;


