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

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [Context](./context.context.md) &gt; [createView](./context.context.createview.md)

## Context.createView() method

Create a view of the context chain with the given binding filter

**Signature:**

```typescript
createView<T = unknown>(filter: BindingFilter, comparator?: BindingComparator, options?: Omit<ResolutionOptions, 'session'>): ContextView<T>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

filter


</td><td markdown="1">

[BindingFilter](./context.bindingfilter.md)


</td><td markdown="1">

A function to match bindings


</td></tr>
<tr><td markdown="1">

comparator


</td><td markdown="1">

[BindingComparator](./context.bindingcomparator.md)


</td><td markdown="1">

_(Optional)_ A function to sort matched bindings


</td></tr>
<tr><td markdown="1">

options


</td><td markdown="1">

Omit&lt;[ResolutionOptions](./context.resolutionoptions.md)<!-- -->, 'session'&gt;


</td><td markdown="1">

_(Optional)_ Resolution options


</td></tr>
</tbody></table>

**Returns:**

[ContextView](./context.contextview.md)<!-- -->&lt;T&gt;


