---
lang: en
title: 'API docs: repository.includerelatedmodels'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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?: Inclusion<T>[], options?: Options): Promise<(T & Relations)[]>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  targetRepository | <code>EntityCrudRepository&lt;T, unknown, Relations&gt;</code> | The target repository where the model instances are found |
|  entities | <code>T[]</code> | An array of entity instances or data |
|  include | <code>Inclusion&lt;T&gt;[]</code> | Inclusion filter |
|  options | <code>Options</code> | Options for the operations |

<b>Returns:</b>

`Promise<(T & Relations)[]>`


