diff --git a/content/_partials/query-functions.md b/content/_partials/query-functions.md deleted file mode 100644 index 7ec38a64..00000000 --- a/content/_partials/query-functions.md +++ /dev/null @@ -1,16 +0,0 @@ -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 | diff --git a/content/guides/04.connect/2.filter-rules.md b/content/guides/04.connect/2.filter-rules.md index 2740aa0f..10b6d31d 100644 --- a/content/guides/04.connect/2.filter-rules.md +++ b/content/guides/04.connect/2.filter-rules.md @@ -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 diff --git a/content/guides/04.connect/3.query-parameters.md b/content/guides/04.connect/3.query-parameters.md index bc18b546..7ac640f0 100644 --- a/content/guides/04.connect/3.query-parameters.md +++ b/content/guides/04.connect/3.query-parameters.md @@ -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]