---
lang: en
title: 'API docs: context.filterbytag'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.filterbytag.html
---

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [filterByTag](./context.filterbytag.md)

## filterByTag() function

Create a binding filter for the tag pattern

**Signature:**

```typescript
export declare function filterByTag(tagPattern: BindingTag | RegExp): BindingTagFilter;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tagPattern


</td><td>

[BindingTag](./context.bindingtag.md) \| RegExp


</td><td>

Binding tag name, regexp, or object


</td></tr>
</tbody></table>

**Returns:**

[BindingTagFilter](./context.bindingtagfilter.md)


