Back

problem in relation

  • 1
  • Flutter
mo7amedtech
21 Oct, 2023, 13:32

Hello when i try to make one to many relation, allow me to add only 25 items but if my collection contain more than this, how can i solve it ?!

TL;DR
The user is seeking help in solving a problem related to a one-to-many relationship. They are confused about whether the problem is with parent or child documents and ask for better examples and more context. They also mention the use of pagination instead of returning all documents at once. Another user suggests using a function to validate and limit the number of documents in the relationship, and only giving read permissions to the collection. The original user is still confused and unsure about how to solve the problem.
mo7amedtech
21 Oct, 2023, 13:32

@Moderator

mo7amedtech
21 Oct, 2023, 13:42

@Core

D5
21 Oct, 2023, 13:45

No need to pin everyone πŸ˜…

mo7amedtech
21 Oct, 2023, 13:47

I am sorry but this problem confuse me. πŸ˜…

D5
21 Oct, 2023, 13:50

I think in such case it will be better to handle that without a relationship

Guille
21 Oct, 2023, 13:53

In that case you should use a function to validate that, and only give read permissions to the collection. That way you make sure that write operation must be done by the function

mo7amedtech
21 Oct, 2023, 13:56

I need to return all documents ?!

Guille
21 Oct, 2023, 13:58

If I understood well you want to limit the number of documents in the relation to 25 items right?

mo7amedtech
21 Oct, 2023, 14:01

Yes i need to return all of collection items

D5
21 Oct, 2023, 14:41

You should not get all documents at once

D5
21 Oct, 2023, 14:42

Unless it's 100% needed. Instead you should use pagination

D5
21 Oct, 2023, 14:42

And not a relationship

VincentGe
22 Oct, 2023, 18:59

I'm very confused by what you're asking

VincentGe
22 Oct, 2023, 19:00

Do you have better examples and more context?

VincentGe
22 Oct, 2023, 19:00

Also please don't tag everyone and be patient. This is a community server, and it's very disruptive to be mass tagging people.

Guille
24 Oct, 2023, 12:01

I'm a little confuse too, relationship currently return all child documents, are you talking about parent documents?

Haimantika
26 Oct, 2023, 09:12

Hi @mo7amedtech could you solve it?

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