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

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

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

## HasOneRepository.get() method

Find the only target model instance that belongs to the declaring model.

<b>Signature:</b>

```typescript
get(filter?: Pick<Filter<Target>, Exclude<keyof Filter<Target>, 'where'>>, options?: Options): Promise<Target>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  filter | <code>Pick&lt;Filter&lt;Target&gt;, Exclude&lt;keyof Filter&lt;Target&gt;, 'where'&gt;&gt;</code> | Query filter without a Where condition |
|  options | <code>Options</code> | Options for the operations |

<b>Returns:</b>

`Promise<Target>`

A promise of the target object or null if not found.


