---
lang: en
title: 'API docs: context.createviewgetter_1'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.createviewgetter_1.html
---

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [createViewGetter](./context.createviewgetter_1.md)

## createViewGetter() function

Create a context view as a getter with the given filter and sort matched bindings by the comparator.

<b>Signature:</b>

```typescript
export declare function createViewGetter<T = unknown>(ctx: Context, bindingFilter: BindingFilter, bindingComparator?: BindingComparator, session?: ResolutionSession): Getter<T[]>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  ctx | [Context](./context.context.md) | Context object |
|  bindingFilter | [BindingFilter](./context.bindingfilter.md) | A function to match bindings |
|  bindingComparator | [BindingComparator](./context.bindingcomparator.md) | A function to compare two bindings |
|  session | [ResolutionSession](./context.resolutionsession.md) | Resolution session |

<b>Returns:</b>

[Getter](./context.getter.md)<!-- -->&lt;T\[\]&gt;


