Back

[SOLVED] Relationship and Rate Limit

  • 0
  • Databases
  • Flutter
djcali
18 Jul, 2023, 03:38

Hello, I have a userData collection which stores a users info like address etc. I have a couple of relationships with other collections which could have a lot of data related to the user. My question is when i query the userData document for a user I see that I get returned the related collections documents also. My question is how many records will it return, i'm guessing its the rate limit of 25. I'll need to know since one of the related collections is userEvents and will eventually have a decent amount of data. What I do know is instead of querying the userData and separately querying the userEvents I just query the userData and add the userEvents to a list because the data is already there. How will this work with pagination and what order does the related collection data come in? from the last created to the oldest or from the first created to the newest? Is there an option to control this?

Thanks!

TypeScript
      final data = await ref.read(databaseProvider).listDocuments(
        databaseId: Database.databaseId,
        collectionId: Collections.userData,
        queries: [
          Query.equal('accountId', ref.read(sessionController).currentUser!.$id)
        ],
      );```
TL;DR
The user is querying the userData collection for a user and noticing that the related collections' documents are also returned. They are wondering how many records will be returned and if it aligns with the rate limit of 25. They also need to know how pagination will work and the order in which the related collection data is returned. Finally, they are seeking an option to control this behavior. Solution: The user should paginate the query results by adding a pagination mechanism to their code. They can control the order of the related collection data by specifying a sort order in their query. For example, they can use a field like "createdAt" to sort
Drake
18 Jul, 2023, 03:48

Right now, all the related data is returned 😅

We plan to add a way to paginate

djcali
18 Jul, 2023, 03:51

I guess no worries for the time being. Thanks!

djcali
18 Jul, 2023, 05:16

Relationship and Rate Limit [SOLVED]

djcali
18 Jul, 2023, 05:16

[SOLVED] Relationship and Rate Limit

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more