<commit_before># Filters

See the [filters' concepts](../concepts/concepts.md#filters) for details.

> Note: by default, the filters can only be used from `find` endpoints generated by the Content Type Builder and the [CLI](../cli/CLI.md). If you need to implement a filters system somewhere else, read the [programmatic usage](#programmatic-usage) section.

## Available operators

The available operators are separated in four different categories:
 - [Filters](#filters)
 - [Sort](#sort)
 - [Limit](#limit)
 - [Start](#start)

### Filters

Easily filter results according to fields values.

 - `=`: Equals
 - `_ne`: Not equals
 - `_lt`: Lower than
 - `_gt`: Greater than
 - `_lte`: Lower than or equal to
 - `_gte`: Greater than or equal to
 - `_contains`: Contains
 - `_containss`: Contains case sensitive

#### Examples

Find users having `John` as first name.

`GET /user?firstName=John`

Find products having a price equal or greater than `3`.

`GET /product?price_gte=3`

### Sort

Sort according to a specific field.

#### Example

Sort users by email.

 - ASC: `GET /user?_sort=email:asc` or `GET /user?_sort=email`
 - DESC: `GET /user?_sort=email:desc` or `GET /user?_sort=-email`

### Limit

Limit the size of the returned results.

#### Example

Limit the result length to 30.

`GET /user?_limit=30`

### Start

Skip a specific number of entries (especially useful for pagination).

#### Example

Get the second page of results.

`GET /user?_start=10&_limit=10`

## Programmatic usage

Requests system can be implemented in custom code sections.<commit_msg>Update filters documentation. Remove deprecated filter options on sorting: Allow only _sort=attr:ASC or _sort=attr:DESC<commit_after># Filters

See the [filters' concepts](../concepts/concepts.md#filters) for details.

> Note: by default, the filters can only be used from `find` endpoints generated by the Content Type Builder and the [CLI](../cli/CLI.md). If you need to implement a filters system somewhere else, read the [programmatic usage](#programmatic-usage) section.

## Available operators

The available operators are separated in four different categories:
 - [Filters](#filters)
 - [Sort](#sort)
 - [Limit](#limit)
 - [Start](#start)

### Filters

Easily filter results according to fields values.

 - `=`: Equals
 - `_ne`: Not equals
 - `_lt`: Lower than
 - `_gt`: Greater than
 - `_lte`: Lower than or equal to
 - `_gte`: Greater than or equal to
 - `_contains`: Contains
 - `_containss`: Contains case sensitive

#### Examples

Find users having `John` as first name.

`GET /user?firstName=John`

Find products having a price equal or greater than `3`.

`GET /product?price_gte=3`

### Sort

Sort according to a specific field.

#### Example

Sort users by email.

 - ASC: `GET /user?_sort=email:asc`
 - DESC: `GET /user?_sort=email:desc`

### Limit

Limit the size of the returned results.

#### Example

Limit the result length to 30.

`GET /user?_limit=30`

### Start

Skip a specific number of entries (especially useful for pagination).

#### Example

Get the second page of results.

`GET /user?_start=10&_limit=10`

## Programmatic usage

Requests system can be implemented in custom code sections.
{'fraction_non_alphanumeric': 0.12002507051081165, 'fraction_numerical': 0.006267627702914447, 'mean_word_length': 4.198697068403908, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098944', 'n_tokens_mistral': 999, 'n_tokens_neox': 948, 'n_words': 384}