Skip to content

Commit a1f815d

Browse files
committed
docs(api-server): update data access documentation
- Clarify read-only models and their management process - Enhance description of special filter for country model - Improve wording and structure for better understanding
1 parent 563cf01 commit a1f815d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/content/docs/api-server/reference/data-access.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following model names are supported:
3232
- `dashboard_summary`
3333

3434
<Aside type="caution" title="Read-Only Models">
35-
The `country` and `language` models are configured to be **read-only** through the API (i.e., they do not support `POST`, `PUT`, or `DELETE` requests). This is an intentional design choice, as this foundational data is managed via the database seeding process.
35+
The `country` and `language` models are configured to be **read-only** through the API (i.e., they do not support `POST`, `PUT`, or `DELETE` requests). This is an intentional design choice. This foundational data is managed via the database seeding process.
3636
</Aside>
3737

3838
<Aside type="caution">
@@ -51,10 +51,12 @@ Retrieves a paginated list of items for a specific model.
5151
#### Query Parameters
5252

5353
- **`filter`** (string, optional): A URL-encoded JSON string representing a MongoDB-style query.
54-
<Aside type="note" title="Special Filter for Country Model">
55-
For the `country` model, the `filter` parameter supports a special `usage` key. This allows you to retrieve countries based on their role in other data:
54+
<Aside type="note" title="Special Filter for Country Model: 'usage'">
55+
For the `country` model, the `filter` parameter supports a special `usage` key. This allows you to retrieve a curated list of countries that are relevant to existing content, rather than all countries globally. This is particularly useful for populating dynamic dropdowns or filters in client applications.
56+
5657
- `filter={"usage":"eventCountry"}`: Returns countries referenced as `eventCountry` in headlines.
5758
- `filter={"usage":"headquarters"}`: Returns countries referenced as `headquarters` in sources.
59+
5860
When using the `usage` filter for the `country` model, the response will **not** be paginated and will return the complete filtered set of countries.
5961
</Aside>
6062
- **`sort`** (string, optional): A comma-separated list of fields to sort by (e.g., `createdAt:desc,title:asc`).

0 commit comments

Comments
 (0)