---
lang: en
title: 'API docs: repository.hasonedefinition.keyto'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.hasonedefinition.keyto.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [HasOneDefinition](./repository.hasonedefinition.md) &gt; [keyTo](./repository.hasonedefinition.keyto.md)

## HasOneDefinition.keyTo property

The foreign key used by the target model.

E.g. when a Customer has one Address instance, then keyTo is "customerId". Note that "customerId" is the default FK assumed by the framework, users can provide a custom FK name by setting "keyTo".

<b>Signature:</b>

```typescript
keyTo?: string;
```

