mirror of
https://github.com/directus/directus.git
synced 2026-01-30 04:58:17 -05:00
Merge branch 'main' into aggregation
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
::: tip Uploading Files
|
||||
|
||||
To learn more about uploading files, see the [Upload a File](/reference/api/system/files/#upload-a-file) and
|
||||
[Import a File](<(/reference/api/system/files/#import-a-file)>) endpoints.
|
||||
[Import a File](/reference/api/system/files/#import-a-file) endpoints.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
@@ -125,14 +125,17 @@ needs, you can extend the above environment variables to configure any of
|
||||
|
||||
## Cache
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
| ------------------------ | -------------------------------------------------------------------------------------- | ---------------- |
|
||||
| `CACHE_ENABLED` | Whether or not caching is enabled. | `false` |
|
||||
| `CACHE_TTL` | How long the cache is persisted. | `30m` |
|
||||
| `CACHE_CONTROL_S_MAXAGE` | Whether to not to add the s-maxage expiration flag. Set to a number for a custom value | `0` |
|
||||
| `CACHE_AUTO_PURGE` | Automatically purge the cache on `create`/`update`/`delete` actions. | `false` |
|
||||
| `CACHE_NAMESPACE` | How to scope the cache data. | `directus-cache` |
|
||||
| `CACHE_STORE` | Where to store the cache data. Either `memory`, `redis`, or `memcache`. | `memory` |
|
||||
| Variable | Description | Default Value |
|
||||
| ----------------------------- | -------------------------------------------------------------------------------------------- | ---------------- |
|
||||
| `CACHE_ENABLED` | Whether or not caching is enabled. | `false` |
|
||||
| `CACHE_TTL` | How long the cache is persisted. | `30m` |
|
||||
| `CACHE_CONTROL_S_MAXAGE` | Whether to not to add the s-maxage expiration flag. Set to a number for a custom value | `0` |
|
||||
| `CACHE_AUTO_PURGE` | Automatically purge the cache on `create`/`update`/`delete` actions. | `false` |
|
||||
| `CACHE_SCHEMA` <sup>[1]</sup> | Whether or not the database schema is cached. One of `false`, `true`, or a string time value | `true` |
|
||||
| `CACHE_NAMESPACE` | How to scope the cache data. | `directus-cache` |
|
||||
| `CACHE_STORE` | Where to store the cache data. Either `memory`, `redis`, or `memcache`. | `memory` |
|
||||
|
||||
<sup>[1]</sup> `CACHE_SCHEMA` ignores the `CACHE_ENABLED` value
|
||||
|
||||
Based on the `CACHE_STORE` used, you must also provide the following configurations:
|
||||
|
||||
|
||||
@@ -48,24 +48,28 @@
|
||||
|
||||
## Filter Operators
|
||||
|
||||
| Operator | Description |
|
||||
| ------------ | -------------------------------------- |
|
||||
| `_eq` | Equal to |
|
||||
| `_neq` | Not equal to |
|
||||
| `_lt` | Less than |
|
||||
| `_lte` | Less than or equal to |
|
||||
| `_gt` | Greater than |
|
||||
| `_gte` | Greater than or equal to |
|
||||
| `_in` | Exists in one of the values |
|
||||
| `_nin` | Not in one of the values |
|
||||
| `_null` | It is null |
|
||||
| `_nnull` | It is not null |
|
||||
| `_contains` | Contains the substring |
|
||||
| `_ncontains` | Doesn't contain the substring |
|
||||
| `_between` | The value is between two values |
|
||||
| `_nbetween` | The value is not between two values |
|
||||
| `_empty` | The value is empty (null or falsy) |
|
||||
| `_nempty` | The value is not empty (null or falsy) |
|
||||
| Operator | Description |
|
||||
| --------------- | -------------------------------------- |
|
||||
| `_eq` | Equal to |
|
||||
| `_neq` | Not equal to |
|
||||
| `_lt` | Less than |
|
||||
| `_lte` | Less than or equal to |
|
||||
| `_gt` | Greater than |
|
||||
| `_gte` | Greater than or equal to |
|
||||
| `_in` | Exists in one of the values |
|
||||
| `_nin` | Not in one of the values |
|
||||
| `_null` | It is null |
|
||||
| `_nnull` | It is not null |
|
||||
| `_contains` | Contains the substring |
|
||||
| `_ncontains` | Doesn't contain the substring |
|
||||
| `_starts_with` | Contains the substring |
|
||||
| `_nstarts_with` | Doesn't contain the substring |
|
||||
| `_ends_with` | Contains the substring |
|
||||
| `_nends_with` | Doesn't contain the substring |
|
||||
| `_between` | The value is between two values |
|
||||
| `_nbetween` | The value is not between two values |
|
||||
| `_empty` | The value is empty (null or falsy) |
|
||||
| `_nempty` | The value is not empty (null or falsy) |
|
||||
|
||||
The following operators are **only available in validation permissions**:
|
||||
|
||||
|
||||
@@ -68,25 +68,27 @@ The storage implementation. See [Storage](#storage) for more information.
|
||||
|
||||
Defaults to an instance of `MemoryStorage` when in node.js, and `LocalStorage` when in browsers.
|
||||
|
||||
**NOTE:**
|
||||
**NOTE:**
|
||||
|
||||
If you plan to use multiple SDK instances at once, keep in mind that they will share the Storage across them, leading to unpredictable behaviors. This scenario might be a case while writing tests.
|
||||
If you plan to use multiple SDK instances at once, keep in mind that they will share the Storage across them, leading to
|
||||
unpredictable behaviors. This scenario might be a case while writing tests.
|
||||
|
||||
For example, the SDK instance that executed last the `login()` method writes the resulting `access_token` into the Storage and **overwrites** any prior fetched `access_token` from any other SDK instance. That might mix up your test scenario by granting false access rights to your previous logged-in users.
|
||||
For example, the SDK instance that executed last the `login()` method writes the resulting `access_token` into the
|
||||
Storage and **overwrites** any prior fetched `access_token` from any other SDK instance. That might mix up your test
|
||||
scenario by granting false access rights to your previous logged-in users.
|
||||
|
||||
Adding prefixes to your Storage instances would solve this error:
|
||||
|
||||
```js
|
||||
import { Directus, MemoryStorage } from "@directus/sdk";
|
||||
import { randomBytes } from "crypto";
|
||||
import { Directus, MemoryStorage } from '@directus/sdk';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
// ...
|
||||
|
||||
const prefix = randomBytes(8).toString("hex");
|
||||
const prefix = randomBytes(8).toString('hex');
|
||||
const storage = new MemoryStorage(prefix);
|
||||
const url = `http://${host}:${port}`;
|
||||
const directus = new Directus(url, { storage });
|
||||
|
||||
```
|
||||
|
||||
#### `options.transport`
|
||||
|
||||
Reference in New Issue
Block a user