---
lang: en
title: 'API docs: repository.repositorymixindoc.getrepository'
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.repositorymixindoc.getrepository.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [RepositoryMixinDoc](./repository.repositorymixindoc.md) &gt; [getRepository](./repository.repositorymixindoc.getrepository.md)

## RepositoryMixinDoc.getRepository() method

Retrieve the repository instance from the given Repository class

<b>Signature:</b>

```typescript
getRepository<R extends Repository<any>>(repo: Class<R>): Promise<R>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  repo | [Class](./repository.class.md)<!-- -->&lt;R&gt; | The repository class to retrieve the instance of |

<b>Returns:</b>

Promise&lt;R&gt;


