Skip to content

Commit

Permalink
Port #2222
Browse files Browse the repository at this point in the history
  • Loading branch information
pwizla committed Sep 18, 2024
1 parent c1a117c commit d3d15f3
Showing 1 changed file with 1 addition and 54 deletions.
55 changes: 1 addition & 54 deletions docusaurus/docs/dev-docs/api/document-service/populate.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,60 +215,7 @@ const documents = await strapi.documents("api::article.article").findMany({
</Response>
</ApiCall>

Dynamic zones are highly dynamic content structures by essence. When populating dynamic zones, you can choose between a shared population strategy or a detailed population strategy.

In a shared population strategy, apply a unique behavior for all the dynamic zone's components.

<ApiCall noSideBySide>
<Request title="Example request">

```js
const documents = await strapi.documents("api::article.article").findMany({
populate: {
testDZ: "*",
},
});
```

</Request>

<Response title="Example response">

```json
[
{
"id": "cjld2cjxh0000qzrmn831i7rn",
"title": "Test Article",
"slug": "test-article",
"body": "Test 1",
// ...
"testDZ": [
{
"id": 3,
"__component": "test.test-compo",
"testString": "test1",
"testNestedCompo": {
"id": 3,
"testNestedString": "testNested1"
},
"otherField": "test"
},
{
"id": 1,
"__component": "test.test-compo2",
"testInt": 1,
"otherField": "test"
}
]
}
// ...
]
```

</Response>
</ApiCall>

With the detailed population strategy, define per-component populate queries using the on property.
Dynamic zones are highly dynamic content structures by essence. To populate a dynamic zone, you must define per-component populate queries using the `on` property.

<ApiCall noSideBySide>
<Request title="Example request">
Expand Down

0 comments on commit d3d15f3

Please sign in to comment.