@loopback/docs
Version:
Documentation for LoopBack 4
34 lines (21 loc) • 1.33 kB
Markdown
---
lang: en
title: 'API docs: context.context.find'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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
<b>Signature:</b>
```typescript
find<ValueType = BoundValue>(pattern?: string | RegExp | BindingFilter): Readonly<Binding<ValueType>>[];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| pattern | <code>string | RegExp | BindingFilter</code> | A filter function, a regexp or a wildcard pattern with optional <code>*</code> and <code>?</code>. Find returns such bindings where the key matches the provided pattern.<!-- -->For a wildcard: - <code>*</code> matches zero or more characters except <code>.</code> and <code>:</code> - <code>?</code> matches exactly one character except <code>.</code> and <code>:</code>For a filter function: - return <code>true</code> to include the binding in the results - return <code>false</code> to exclude it. |
<b>Returns:</b>
`Readonly<Binding<ValueType>>[]`