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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [includeFieldIfNot](./repository.includefieldifnot.md)

## includeFieldIfNot() function

<b>Signature:</b>

```typescript
export declare function includeFieldIfNot<MT>(fields: Fields<MT> | undefined, fieldToInclude: Extract<keyof MT, string>): false | Fields<MT>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  fields | [Fields](./filter.fields.md)<!-- -->&lt;MT&gt; \| undefined |  |
|  fieldToInclude | Extract&lt;keyof MT, string&gt; |  |

<b>Returns:</b>

false \| [Fields](./filter.fields.md)<!-- -->&lt;MT&gt;


