Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions content/_partials/query-functions.md

This file was deleted.

16 changes: 15 additions & 1 deletion content/guides/04.connect/2.filter-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,21 @@ You can group multiple rules using the `_and` or `_or` logical operators. Each l

## Functions Parameters

:partial{content="query-functions"}
Functions accept a field and return a modified value. Functions can be used in any query parameter you'd normally supply a field key, including fields, aggregation, and filters.

The syntax for using a function is `function(field)`.

| Function | Description |
| --------- | ----------------------------------------------------------------- |
| `year` | Extract the year from a datetime/date/timestamp field |
| `month` | Extract the month from a datetime/date/timestamp field |
| `week` | Extract the week from a datetime/date/timestamp field |
| `day` | Extract the day from a datetime/date/timestamp field |
| `weekday` | Extract the weekday from a datetime/date/timestamp field |
| `hour` | Extract the hour from a datetime/date/timestamp field |
| `minute` | Extract the minute from a datetime/date/timestamp field |
| `second` | Extract the second from a datetime/date/timestamp field |
| `count` | Extract the number of items from a JSON array or relational field |

::example

Expand Down
17 changes: 16 additions & 1 deletion content/guides/04.connect/3.query-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,22 @@ const result = await directus.request(

## Functions

:partial{content="query-functions"}
Functions accept a field and return a modified value. Functions can be used in any query parameter you'd normally supply a field key, including fields, aggregation, and filters.

The syntax for using a function is `function(field)`.

| Function | Description |
| --------- | ----------------------------------------------------------------- |
| `year` | Extract the year from a datetime/date/timestamp field |
| `month` | Extract the month from a datetime/date/timestamp field |
| `week` | Extract the week from a datetime/date/timestamp field |
| `day` | Extract the day from a datetime/date/timestamp field |
| `weekday` | Extract the weekday from a datetime/date/timestamp field |
| `hour` | Extract the hour from a datetime/date/timestamp field |
| `minute` | Extract the minute from a datetime/date/timestamp field |
| `second` | Extract the second from a datetime/date/timestamp field |
| `count` | Extract the number of items from a JSON array or relational field |
| `json` | Extract a specific value from a JSON field using path notation |

::code-group
```http [REST]
Expand Down