Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bd606a5
Add relations management through REST API
pwizla Dec 7, 2022
8dd4ddf
Add user guide link
pwizla Dec 8, 2022
f208949
Improve formatting
pwizla Dec 8, 2022
b095f68
Add beta badge
pwizla Dec 8, 2022
a6781d9
Fix tense
pwizla Dec 8, 2022
a9b4654
Mention connect & disconnect vs. set alone
pwizla Dec 12, 2022
24642c8
Format code blocks in intro
pwizla Dec 12, 2022
595efad
Add type column to positional arguments
pwizla Dec 12, 2022
fcff67f
Fix tense usage
pwizla Dec 12, 2022
1ba365e
Fix missing spaces in code example
pwizla Dec 12, 2022
af0760c
Fix wording
pwizla Dec 12, 2022
2ed684c
Add backlink to main REST API docs
pwizla Dec 12, 2022
4a071d1
Replace intro code blocks with tabs and API calls components
pwizla Dec 12, 2022
61cb3b8
Fix CSS locally so that API calls don't oversize tabs
pwizla Dec 12, 2022
7df3a9e
Add note about syntaxes
pwizla Dec 12, 2022
a9471d5
Fix tenses
pwizla Dec 12, 2022
dc4284f
Remove POST mention in example
pwizla Dec 12, 2022
b410e90
Add "context" before Combined example
pwizla Dec 12, 2022
9441dc1
Rework the whole document
pwizla Dec 13, 2022
17fcbe5
Remove commented out parts used for the draft
pwizla Dec 13, 2022
9669c77
Fix grammar: position → positions
pwizla Dec 13, 2022
9bca677
Update title (YAML)
pwizla Dec 14, 2022
2679214
Update formatting
pwizla Dec 21, 2022
a94a06d
Update wording
pwizla Dec 21, 2022
299cec0
Update code formatting
pwizla Dec 21, 2022
5908755
Update code formatting
pwizla Dec 21, 2022
6194586
Update code formatting
pwizla Dec 21, 2022
ecd30e5
Update wording
pwizla Dec 21, 2022
5ec5b05
Replace: remove → disconnect
pwizla Jan 17, 2023
cce73a1
Replace: add → connect
pwizla Jan 17, 2023
83d38d1
Reword 'connecting'
pwizla Jan 17, 2023
19565bb
Merge branch 'dev/relations-reordering-alternative' of github.com:str…
pwizla Jan 17, 2023
7899596
Fix intro table
pwizla Jan 17, 2023
0152823
Mention numbers are ids
pwizla Jan 17, 2023
d7c2add
Improve wording and make it more consistent
pwizla Jan 17, 2023
28642eb
Remove 'order' from examples at it's not visible to the user
pwizla Jan 17, 2023
7286a38
Mention we can't connect a relation more than once
pwizla Jan 17, 2023
780b6d7
Be more explicit with examples' goal
pwizla Jan 17, 2023
cc8ff43
Mention relations management in Entity Service and Query Engine APIs
pwizla Jan 17, 2023
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
1 change: 1 addition & 0 deletions docs/.vuepress/config/sidebar-developer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ const developer = [
],
]
},
['/developer-docs/latest/developer-resources/database-apis-reference/rest/relations.html', 'Relations']
],
},
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Syntax: `create(uid: string, parameters: Params)` ⇒ `Entry`
| `populate` | Relations, components and dynamic zones to [populate](/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md) | [`PopulateParameter`<Fa-Link color="grey"/>](/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md) |
| `data` | Input data | `Object` |

!!!include(developer-docs/latest/developer-resources/database-apis-reference/snippets/managing-relations.md)!!!

### Example

```js
Expand All @@ -105,6 +107,8 @@ Updates one entry and returns it.

Syntax: `update(uid: string, id: ID, parameters: Params)` ⇒ `Entry`

!!!include(developer-docs/latest/developer-resources/database-apis-reference/snippets/managing-relations.md)!!!

### Parameters

| Parameter | Description | Type |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ const entry = await strapi.db.query('api::blog.article').create({
});
```

!!!include(developer-docs/latest/developer-resources/database-apis-reference/snippets/managing-relations.md)!!!

## update()

Updates one entry and returns it.
Expand All @@ -139,6 +141,8 @@ const entry = await strapi.db.query('api::blog.article').update({
});
```

!!!include(developer-docs/latest/developer-resources/database-apis-reference/snippets/managing-relations.md)!!!

## delete()

Deletes one entry and returns it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ If the [Internationalization (i18n) plugin](/developer-docs/latest/plugins/i18n.

::::

:::note
While creating an entry, you can define its relations and their order (see [Managing relations through the REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest/relations.md) for more details).
:::

### Update an entry

Partially updates an entry by `id` and returns its value.
Expand Down Expand Up @@ -304,8 +308,9 @@ Fields that aren't sent in the query are not changed in the database. Send a `nu

::::

:::note
Even with the [Internationalization (i18n) plugin](/developer-docs/latest/plugins/i18n.md) installed, it's currently not possible to [update the locale of an entry](/developer-docs/latest/plugins/i18n.md#updating-an-entry).
:::note NOTES
* Even with the [Internationalization (i18n) plugin](/developer-docs/latest/plugins/i18n.md) installed, it's currently not possible to [update the locale of an entry](/developer-docs/latest/plugins/i18n.md#updating-an-entry).
* While updating an entry, you can define its relations and their order (see [Managing relations through the REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest/relations.md) for more details).
:::

### Delete an entry
Expand Down
Loading