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 .
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](/doc/en/lb4/apidocs.filter.filterbuilder.html)
A builder for Filter. It provides fleunt APIs to add clauses such as `fields`, `order`, `where`, `limit`, `offset`, and `include`.
[WhereBuilder](/doc/en/lb4/apidocs.filter.wherebuilder.html)
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)](/doc/en/lb4/apidocs.filter.filtertemplate.html)
[isFilter(candidate)](/doc/en/lb4/apidocs.filter.isfilter.html)
TypeGuard for Filter
Interfaces
Interface
Description
[AndClause](/doc/en/lb4/apidocs.filter.andclause.html)
And clause
[Filter](/doc/en/lb4/apidocs.filter.filter.html)
Query filter object
[Inclusion](/doc/en/lb4/apidocs.filter.inclusion.html)
Inclusion of related items
Note: scope means filter on related items
Example: `{relation: 'aRelationName', scope: {}}`
</td></tr>
[OrClause](/doc/en/lb4/apidocs.filter.orclause.html)
Or clause
</tbody></table>
## Type Aliases
Type Alias
Description
[Condition](/doc/en/lb4/apidocs.filter.condition.html)
Condition clause
[Direction](/doc/en/lb4/apidocs.filter.direction.html)
Order by direction
[Fields](/doc/en/lb4/apidocs.filter.fields.html)
Selection of fields
Example: `{afieldname: true}`
[FilterExcludingWhere](/doc/en/lb4/apidocs.filter.filterexcludingwhere.html)
Filter without `where` property
[InclusionFilter](/doc/en/lb4/apidocs.filter.inclusionfilter.html)
Inclusion filter type e.g. 'property', {relation: 'property'}
[KeyOf](/doc/en/lb4/apidocs.filter.keyof.html)
Key types of a given model, excluding operators
[Operators](/doc/en/lb4/apidocs.filter.operators.html)
Operators for where clauses
[Order](/doc/en/lb4/apidocs.filter.order.html)
Order by
Example: `{afieldname: 'ASC'}`
[PredicateComparison](/doc/en/lb4/apidocs.filter.predicatecomparison.html)
Matching predicate comparison
[ShortHandEqualType](/doc/en/lb4/apidocs.filter.shorthandequaltype.html)
Value types for `{propertyName: value}`
[Where](/doc/en/lb4/apidocs.filter.where.html)
Where clause