---
lang: en
title: 'API docs: context.contextview._constructor_'
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.contextview._constructor_.html
---

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [ContextView](./context.contextview.md) &gt; [(constructor)](./context.contextview._constructor_.md)

## ContextView.(constructor)

Create a context view

**Signature:**

```typescript
constructor(context: Context, filter: BindingFilter, comparator?: BindingComparator | undefined, resolutionOptions?: Omit<ResolutionOptions, "session"> | undefined);
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

context


</td><td>

[Context](./context.context.md)


</td><td>

Context object to watch


</td></tr>
<tr><td>

filter


</td><td>

[BindingFilter](./context.bindingfilter.md)


</td><td>

Binding filter to match bindings of interest


</td></tr>
<tr><td>

comparator


</td><td>

[BindingComparator](./context.bindingcomparator.md) \| undefined


</td><td>

_(Optional)_ Comparator to sort the matched bindings


</td></tr>
<tr><td>

resolutionOptions


</td><td>

Omit&lt;[ResolutionOptions](./context.resolutionoptions.md)<!-- -->, "session"&gt; \| undefined


</td><td>

_(Optional)_


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


