Update README.md

This commit is contained in:
Philipp 2023-01-17 13:47:30 +01:00 committed by GitHub
parent a49c4d2dd8
commit 716b926aa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -300,6 +300,26 @@ const config: PaginateConfig<CatEntity> = {
const result = await paginate<CatEntity>(query, catRepo, config) const result = await paginate<CatEntity>(query, catRepo, config)
``` ```
## Filters
Filter operators must be whitelisted per column in `PaginateConfig`.
### Examples
`?filter.name=$eq:Milo` is equivalent with `?filter.name=Milo`
`?filter.age=$btw:4,6` where column `age` is between `4` and `6`
`?filter.id=$not:$in:2,5,7` where column `id` is **not** `2`, `5` or `7`
`?filter.summary=$not:$ilike:term` where column `summary` does not contain `term`
`?filter.seenAt=$null` where column `seenAt` is `NULL`
`?filter.seenAt=$not:$null` where column `seenAt` is **not** `NULL`
`?filter.createdAt=$btw:2022-02-02,2022-02-10` where column `createdAt` is between the dates `2022-02-02` and `2022-02-10`
## Troubleshooting ## Troubleshooting
The package does not report error reasons in the response bodies. They are instead The package does not report error reasons in the response bodies. They are instead