---
lang: en
title: 'API docs: repository.repositorymixindoc.repository'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.repositorymixindoc.repository.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; [repository](./repository.repositorymixindoc.repository.md)

## RepositoryMixinDoc.repository() method

Add a repository to this application.

<b>Signature:</b>

```typescript
repository(repo: Class<Repository<any>>): Binding;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  repo | <code>Class&lt;Repository&lt;any&gt;&gt;</code> | The repository to add. |

<b>Returns:</b>

`Binding`

## Example


```ts

class NoteRepo {
  model: any;

  constructor() {
    const ds: juggler.DataSource = new juggler.DataSource({
      name: 'db',
      connector: 'memory',
    });

    this.model = ds.createModel(
      'note',
      {title: 'string', content: 'string'},
      {}
    );
  }
};

app.repository(NoteRepo);

```


