@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
65 lines (34 loc) • 1.22 kB
Markdown
---
lang: en
title: 'API docs: filter.filterbuilder.fields'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/filter
permalink: /doc/en/lb4/apidocs.filter.filterbuilder.fields.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/filter](./filter.md) > [FilterBuilder](./filter.filterbuilder.md) > [fields](./filter.filterbuilder.fields.md)
## FilterBuilder.fields() method
Describe what fields to be included/excluded
**Signature:**
```typescript
fields(...f: (Fields<MT> | Extract<keyof MT, string>)[]): this;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
f
</td><td markdown="1">
([Fields](./filter.fields.md)<!-- --><MT> \| Extract<keyof MT, string>)\[\]
</td><td markdown="1">
A field name to be included, an array of field names to be included, or an Fields object for the inclusion/exclusion
</td></tr>
</tbody></table>
**Returns:**
this