@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
37 lines (24 loc) • 1.29 kB
Markdown
---
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) > [@loopback/context](./context.md) > [Context](./context.context.md) > [createView](./context.context.createview.md)
## Context.createView() method
Create a view of the context chain with the given binding filter
<b>Signature:</b>
```typescript
createView<T = unknown>(filter: BindingFilter, comparator?: BindingComparator, options?: Omit<ResolutionOptions, 'session'>): ContextView<T>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| filter | [BindingFilter](./context.bindingfilter.md) | A function to match bindings |
| comparator | [BindingComparator](./context.bindingcomparator.md) | A function to sort matched bindings |
| options | Omit<[ResolutionOptions](./context.resolutionoptions.md)<!-- -->, 'session'> | Resolution options |
<b>Returns:</b>
[ContextView](./context.contextview.md)<!-- --><T>