filterpagingsorting
Filtering
Thefilter field allows the filtering of fields based on the shape of the object the filter is used for.
See the filter reference for a complete list of comparisons available.
The
Filter interface is typesafe and the typescript compiler will complain if you include extra fields that are not present on
the type you are creating the query for.'Foo Bar'
Simple
Multiple Fields
You can also filter on multiple fields.Multiple Comparisons on a single field.
If you include multiple comparisons for a single field they will be ORed together.And/Or
The filter also allows for more complexand and or filters. The and and or accept an array of filters allowing for nested complex queries.
In this example we AND two filters for the same property together: age >= 10 AND age <= 20.
OR condition is created: age >= 10 OR title NOT LIKE '%bar'
AND and OR filters: age >= 10 AND (title LIKE '%bar' OR title = 'foobar').
Paging
Thecore package defines a basic paging interface has two optional fields limit and offset.
- Limit And Offset
- Limit
- Offset
Sorting
Thesorting field allows to specify the sort order for your query.
The sorting field is an array of object containing:
field- the field to sort ondirection-ASCorDESCnulls?- Optional nulls sort,NULLS_FIRSTorNULLS_LAST
- Single-Sort
- Multi-Sort
Filter Reference
Thefilter option supports the following field comparisons.
The following examples show an approximation of the SQL that will be generated. The ORM will take care of handling the dialect
specifics
Common Comparisons
All types support the following comparisons.is- Check is a field isnull,trueorfalse.isNot- Check is a field is notnull,trueorfalse.neq- field is not equal to a value.gt- field is greater than a value.gte- field is greater than or equal to a value.lt- field is less than a value.lte- field is less than or equal to a value.in- field is in a list of values.notIn- field is not in a list of values.
String Comparisons
like- field is like a value (case sensitive).notLike- field is not like a value (case sensitive).iLike- field is like a value (case insensitive).notILike- field is not like a value (case insensitive).