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

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

[Home](./index.md) &gt; [@loopback/filter](./filter.md)

## filter package

A set of utility typings and filter builders to aid in constructing LoopBack filters using the [builder pattern](https://en.wikipedia.org/wiki/Builder_pattern)<!-- -->.

## Remarks

This lightweight module provides strongly-typed typings and filter builders to intuitively construct LoopBack filters to be used against querying a LoopBack filter-compatible server over the network or within the server itself.

## Classes

|  Class | Description |
|  --- | --- |
|  [FilterBuilder](./filter.filterbuilder.md) | A builder for Filter. It provides fleunt APIs to add clauses such as <code>fields</code>, <code>order</code>, <code>where</code>, <code>limit</code>, <code>offset</code>, and <code>include</code>. |
|  [WhereBuilder](./filter.wherebuilder.md) | A builder for Where object. It provides fluent APIs to add clauses such as <code>and</code>, <code>or</code>, and other operators. |

## Functions

|  Function | Description |
|  --- | --- |
|  [filterTemplate(strings, keys)](./filter.filtertemplate.md) |  |
|  [isFilter(candidate)](./filter.isfilter.md) | TypeGuard for Filter |

## Interfaces

|  Interface | Description |
|  --- | --- |
|  [AndClause](./filter.andclause.md) | And clause |
|  [Filter](./filter.filter.md) | Query filter object |
|  [Inclusion](./filter.inclusion.md) | <p>Inclusion of related items</p><p>Note: scope means filter on related items</p><p>Example: <code>{relation: 'aRelationName', scope: {&lt;AFilterObject&gt;}}</code></p> |
|  [OrClause](./filter.orclause.md) | Or clause |

## Type Aliases

|  Type Alias | Description |
|  --- | --- |
|  [Condition](./filter.condition.md) | Condition clause |
|  [Direction](./filter.direction.md) | Order by direction |
|  [Fields](./filter.fields.md) | <p>Selection of fields</p><p>Example: <code>{afieldname: true}</code></p> |
|  [FilterExcludingWhere](./filter.filterexcludingwhere.md) | Filter without <code>where</code> property |
|  [InclusionFilter](./filter.inclusionfilter.md) | Inclusion filter type e.g. 'property', {<!-- -->relation: 'property'<!-- -->} |
|  [KeyOf](./filter.keyof.md) | Key types of a given model, excluding operators |
|  [Operators](./filter.operators.md) | Operators for where clauses |
|  [Order](./filter.order.md) | <p>Order by</p><p>Example: <code>{afieldname: 'ASC'}</code></p> |
|  [PredicateComparison](./filter.predicatecomparison.md) | Matching predicate comparison |
|  [ShortHandEqualType](./filter.shorthandequaltype.md) | Value types for <code>{propertyName: value}</code> |
|  [Where](./filter.where.md) | Where clause |


