---
lang: en
title: 'API docs: repository.repositorymixindoc.repository'
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.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 | [Class](./repository.class.md)<!-- -->&lt;[Repository](./repository.repository.md)<!-- -->&lt;any&gt;&gt; | The repository to add. |

<b>Returns:</b>

[Binding](./context.binding.md)

## 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);
```


