Page Contents

Home > @loopback/filter

filter package

A set of utility typings and filter builders to aid in constructing LoopBack filters using the 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

A builder for Filter. It provides fleunt APIs to add clauses such as fields, order, where, limit, offset, and include.

WhereBuilder

A builder for Where object. It provides fluent APIs to add clauses such as and, or, and other operators.

Functions

Function Description

filterTemplate(strings, keys)

isFilter(candidate)

TypeGuard for Filter

Interfaces

Interface Description

AndClause

And clause

Filter

Query filter object

Inclusion

Inclusion of related items

Note: scope means filter on related items

Example: {relation: 'aRelationName', scope: {<AFilterObject>}}

OrClause

Or clause

Type Aliases

Type Alias Description

Condition

Condition clause

Direction

Order by direction

Fields

Selection of fields

Example: {afieldname: true}

FilterExcludingWhere

Filter without where property

InclusionFilter

Inclusion filter type e.g. ‘property’, {relation: ‘property’}

KeyOf

Key types of a given model, excluding operators

Operators

Operators for where clauses

Order

Order by

Example: {afieldname: 'ASC'}

PredicateComparison

Matching predicate comparison

ShortHandEqualType

Value types for {propertyName: value}

Where

Where clause