@loopback/docs
Version:
Documentation for LoopBack 4
34 lines (21 loc) • 818 B
Markdown
lang: en
title: 'API docs: context.filterbykey'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.filterbykey.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [filterByKey](./context.filterbykey.md)
## filterByKey() function
Create a binding filter from key pattern
<b>Signature:</b>
```typescript
export declare function filterByKey(keyPattern?: string | RegExp | BindingFilter): BindingFilter;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| keyPattern | <code>string | RegExp | BindingFilter</code> | Binding key/wildcard, regexp, or a filter function |
<b>Returns:</b>
`BindingFilter`