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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Add a max_depth Query function #7034

Open
2 tasks done
mattie-cmsp opened this issue Oct 28, 2023 · 3 comments
Open
2 tasks done

馃殌 Feature: Add a max_depth Query function #7034

mattie-cmsp opened this issue Oct 28, 2023 · 3 comments
Labels
feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.

Comments

@mattie-cmsp
Copy link

mattie-cmsp commented Oct 28, 2023

馃敄 Feature description

Add a new Query function to limit/raise the depth of relationship results.

馃帳 Pitch

As it stands, requesting an object that has relationships, without providing a select Query parameter, will result in objects that are up to 4 levels deep, which can be a very significant amount of data, especially since those relations might be X-to-many relations, and could be whole lists of lists of objects.

As the max depth is already being counted, I suspect that it might be easy to implement max_depth as a Query parameter that would simply adjust the existing max depth value in the current logic for this query. Providing this feature, soonish, could work as a stop gap measure to allow users much more efficient use of request/queries until full relationship query support is complete. And this is a feature that would continue to make sense once that full relationship query support is live, as well.

I'd be willing to work on a PR for this, or a related FR I made, 7033, if no one with better knowledge of the codebase is available to do so.

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@stnguyen90 stnguyen90 added product / databases Fixes and upgrades for the Appwrite Database. feature / relationships Fixes and upgrades for database relationships labels Oct 31, 2023
@stnguyen90
Copy link
Contributor

@mattie-cmsp, thanks for creating this issue! 馃檹馃徏 We're not sure if we want to move forward with this approach at the moment, but we'll keep this in mind.

@arvidev-developer
Copy link

arvidev-developer commented Feb 4, 2024

This is very necessary, I want the relationship but I'm not interested in the nested return every time, just in the keys, and sometimes 3 levels as default is already great

@ohbob
Copy link

ohbob commented Feb 14, 2024

I had the same feeling, started using relationships and could not find any depth control, dropped the idea, because of the amount of incoming data. It's not usable in current state, with out that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

4 participants