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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultHasOneRepository](./repository.defaulthasonerepository.md) &gt; [get](./repository.defaulthasonerepository.get.md)

## DefaultHasOneRepository.get() method

**Signature:**

```typescript
get(filter?: Pick<Filter<TargetEntity>, Exclude<keyof Filter<TargetEntity>, 'where'>>, options?: Options & {
        polymorphicType?: string | string[];
    }): Promise<TargetEntity>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  filter | Pick&lt;[Filter](./filter.filter.md)<!-- -->&lt;TargetEntity&gt;, Exclude&lt;keyof [Filter](./filter.filter.md)<!-- -->&lt;TargetEntity&gt;, 'where'&gt;&gt; | _(Optional)_ |
|  options | [Options](./repository.options.md) &amp; { polymorphicType?: string \| string\[\]; } | _(Optional)_ |

**Returns:**

Promise&lt;TargetEntity&gt;


