Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The population and pagination operators cannot be combined. #1585

Open
Boegie19 opened this issue Mar 9, 2023 · 1 comment
Open
Assignees
Labels
issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io

Comments

@Boegie19
Copy link
Contributor

Boegie19 commented Mar 9, 2023

Link to the documentation page or resource

https://docs.strapi.io/dev-docs/api/rest/populate-select#combining-population-with-other-operators

Describe the bug

I am 99% sure that you can limit and use offset while populating so saying that you can not is strange + it will cause people to not limit there stuff with populates (this is only on the top level or the request the docs make it sound like it is not possible at all)

Additional context

No response

Suggested improvements or fixes

remove it or clarify its meaning

Related issue(s)/PR(s)

https://forum.strapi.io/t/advanced-api-filter-combining-and-and-or/24375/10

@Boegie19 Boegie19 changed the title [Bug]: populate and paginate not possible together [Bug]: The population and pagination operators cannot be combined. Mar 9, 2023
@pwizla pwizla self-assigned this Oct 18, 2023
@pwizla pwizla added the issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io label Oct 18, 2023
@mohammadGh
Copy link

The documentation is not clear about this issue, i.e "pagination on population". If this feature does not exist, it is better to explain the reason transparently. Or if it exists and, for example, it is not recommended to do this from a performance perspective, it should be explained.

Currently, pagination on population with the ‍‍limit and start keys works in version v4.9 (although no information about the total number of paginated items is provided in the output).
For example, the following API correctly retrieves the first post and returns only the second five comments for this post.

Strapi Version: v4.9.2
Get: /api/posts?fields=title&populate[comments][limit]=5&populate[comments][start]=5
Result: It works correctly.

However, using ‍pageSize and page in this case does not work. i.e:

Strapi Version: v4.9.2
Get: /api/posts?fields=title&populate[comments][pageSize]=5&populate[comments][page]=2
Result: It doesn't work (it returns all items in the populated field).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io
Projects
None yet
Development

No branches or pull requests

3 participants