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

Limit not apply on o2m #11663

Closed
3 tasks done
proceau opened this issue Feb 16, 2022 · 4 comments
Closed
3 tasks done

Limit not apply on o2m #11663

proceau opened this issue Feb 16, 2022 · 4 comments

Comments

@proceau
Copy link

proceau commented Feb 16, 2022

Preflight Checklist

Describe the Bug

When set fields=toto.*&limit=-1 the sub o2m toto it's limit to 100 item and not -1

To Reproduce

create big collection, add o2m, query and see only first 100 sub item

Errors Shown

no

What version of Directus are you using?

9.5.1

What version of Node.js are you using?

16.0.0

What database are you using?

mariadb 10.3

What browser are you using?

opera

What operating system are you using?

windows

How are you deploying Directus?

vm

@azrikahar
Copy link
Contributor

When we do limit=-1 (or any other query parameters by themselves), it only applies to the queried collection itself and not the O2M collection. You should use the deep query param to apply it to the any nested relationships, and the first example also showcases the exact same use case: https://docs.directus.io/reference/query/#examples-7

To be more specific to your current query, deep[toto][_limit]=-1 should do the trick rather than limit=-1. Hope that clears things up.

@proceau
Copy link
Author

proceau commented Feb 16, 2022

it is clearer for me, but not very practical, it would not be possible to define this value 100 in a global variable of the project to put 1000 or 10000 ?
DIRECTUS_LIMIT=1000 in config

@azrikahar
Copy link
Contributor

azrikahar commented Feb 16, 2022

That is unfortunately not supported as of now, but do feel free to open a discussion about it so that other members of our community can share their thoughts on such configuration 👍

@proceau
Copy link
Author

proceau commented Feb 16, 2022

it is a good practice to make parametric by variables, all arbitrary constants of a program.
thx for your support

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants