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

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [relation](./repository.relation.md)

## relation() function

Decorator for relations

<b>Signature:</b>

```typescript
export declare function relation(definition?: Object): PropertyDecorator;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  definition | <code>Object</code> |  |

<b>Returns:</b>

`PropertyDecorator`

A property decorator


