An extension to get randomized results from directus.
As the name suggests this extension will enable Randomized results mirroring the Directus /items/:collection endpoint.
Tested with Directus 10.6.3
The package is published to npm:
npm install directus-extension-randomized-endpoint
undefinedManual Installationundefined
npm installnpm run buildmv dist extensions/endpoints/directus-extension-randomizedMirrors the REST version of this core endpoint supporting the same parameters https://docs.directus.io/reference/items.html#get-items
undefinedGET /randomized/test_collectionundefined
[
{ "id": 6, "status": "draft", "value": "369" },
{ "id": 2, "status": "published", "value": "456" },
{ "id": 4, "status": "published", "value": "147" },
{ "id": 3, "status": "published", "value": "789" },
{ "id": 5, "status": "draft", "value": "258" },
{ "id": 1, "status": "published", "value": "123" }
]
[
{"id": 3, "status": "published", "value": "789"},
{"id": 4, "status": "published", "value": "147"},
{"id": 1, "status": "published", "value": "123"},
{"id": 2, "status": "published", "value": "456"},
{"id": 5, "status": "draft", "value": "258"},
{"id": 6, "status": "draft", "value": "369"}
]
undefinedGET /randomized/test_collection?limit=2undefined
[
{"id": 4, "status": "published", "value": "147"},
{"id": 5, "status": "draft", "value": "258"}
]
[
{"id": 2, "status": "published", "value": "456"},
{"id": 4, "status": "published", "value": "147"}
]
undefinedGET /randomized/test_collection?limit=2&filter[status][_eq]=published&fields=value,statusundefined
[
{"value": "456", "status": "published"},
{"value": "147", "status": "published"}
]
[
{"value": "789", "status": "published"},
{"value": "147", "status": "published"}
]
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.