Page Contents

Home > @loopback/context > Context > find

Context.find() method

Find bindings using a key pattern or filter function

Signature:

find<ValueType = BoundValue>(pattern?: string | RegExp | BindingFilter): Readonly<Binding<ValueType>>[];

Parameters

Parameter Type Description
pattern string | RegExp | BindingFilter <p>(Optional) A filter function, a regexp or a wildcard pattern with optional * and ?. Find returns such bindings where the key matches the provided pattern.</p><p>For a wildcard: - * matches zero or more characters except . and : - ? matches exactly one character except . and :</p><p>For a filter function: - return true to include the binding in the results - return false to exclude it.</p>

Returns:

Readonly<Binding<ValueType>>[]