---
lang: en
title: 'API docs: repository.reduceassingleitem'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/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.

<b>Signature:</b>

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

## Parameters

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

<b>Returns:</b>

T


