@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
94 lines (51 loc) • 1.62 kB
Markdown
---
lang: en
title: 'API docs: openapi-v3.param.filter'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/openapi-v3
permalink: /doc/en/lb4/apidocs.openapi-v3.param.filter.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/openapi-v3](./openapi-v3.md) > [param](./openapi-v3.param.md) > [filter](./openapi-v3.param.filter.md)
## param.filter() function
Sugar decorator for `filter` query parameter
**Signature:**
```typescript
function filter(modelCtor: typeof Model, options?: string | (FilterSchemaOptions & {
name?: string;
})): (target: object, member: string, index: number) => void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
modelCtor
</td><td markdown="1">
typeof Model
</td><td markdown="1">
Model class
</td></tr>
<tr><td markdown="1">
options
</td><td markdown="1">
string \| ([FilterSchemaOptions](./repository-json-schema.filterschemaoptions.md) & { name?: string; })
</td><td markdown="1">
_(Optional)_ Options to customize the parameter name or filter schema
</td></tr>
</tbody></table>
**Returns:**
(target: object, member: string, index: number) => void
## Example
```ts
async find(
@param.filter(modelCtor)) filter?: Filter<T>,
): Promise<(T & Relations)[]> {
// ...
}
```