Page Contents
Home > @loopback/filter > FilterBuilder
FilterBuilder class
A builder for Filter. It provides fleunt APIs to add clauses such as fields, order, where, limit, offset, and include.
Signature:
export declare class FilterBuilder<MT extends object = AnyObject>
Example
const filterBuilder = new FilterBuilder();
const filter = filterBuilder
.fields('id', 'a', 'b')
.limit(10)
.offset(0)
.order(['a ASC', 'b DESC'])
.where({id: 1})
.build();
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
|
Filter<MT> |
Methods
| Method | Modifiers | Description |
|---|---|---|
|
Return the filter object | ||
|
Describe what fields to be included/excluded | ||
|
Add a Filter or Where constraint object. If it is a filter object, create an | ||
|
Declare | ||
|
Set | ||
|
Set | ||
|
Describe the sorting order | ||
|
Alias to | ||
|
Declare a where clause |