@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
69 lines (36 loc) • 1.58 kB
Markdown
---
lang: en
title: 'API docs: context.context.find'
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.context.find.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [find](./context.context.find.md)
## Context.find() method
Find bindings using a key pattern or filter function
**Signature:**
```typescript
find<ValueType = BoundValue>(pattern?: string | RegExp | BindingFilter): Readonly<Binding<ValueType>>[];
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
pattern
</td><td markdown="1">
string \| RegExp \| [BindingFilter](./context.bindingfilter.md)
</td><td markdown="1">
_(Optional)_ A filter function, a regexp or a wildcard pattern with optional `*` and `?`<!-- -->. Find returns such bindings where the key matches the provided pattern.
For a wildcard: - `*` matches zero or more characters except `.` and `:` - `?` matches exactly one character except `.` and `:`
For a filter function: - return `true` to include the binding in the results - return `false` to exclude it.
</td></tr>
</tbody></table>
**Returns:**
Readonly<[Binding](./context.binding.md)<!-- --><ValueType>>\[\]