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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [reduceAsSingleItem](./repository.reduceassingleitem.md)

## reduceAsSingleItem() function

Returns a single of an instance. For HasOne and BelongsTo relation usage.

**Signature:**

```typescript
export declare function reduceAsSingleItem<T>(_acc: T | undefined, it: T): T;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  \_acc | T \| undefined |  |
|  it | T |  |

**Returns:**

T


