Back

[CLOSED] Relationships in Appwrite Cloud

  • 1
  • Self Hosted
  • Databases
Shubham
13 Aug, 2023, 09:03

how will i make relationship between collections in appwrite cloud?

TL;DR
The user is asking about creating relationships in Appwrite Cloud. They are wondering if it's a good idea to pass a query with 200 elements in an array for each quiz. The suggested solution is to store the IDs of all the questions in an array. The user is also asking whether it's better to store the quiz ID in every question or store all the question IDs in an array for each quiz. The recommended approach is to manually reference document IDs for creating relationships in Appwrite Cloud. However, the user mentions that there is no attribute named "relationship" in Appwrite Cloud. The suggestion is to manually set up relationships by creating
safwan
13 Aug, 2023, 09:34
Shubham
13 Aug, 2023, 09:54

according to this , i need Relationship

Shubham
13 Aug, 2023, 09:55

but there is no attribute named relationship in appwrite cloud

Shubham
13 Aug, 2023, 09:56

I am creating educational app , in that i am creating Quiz , i want to give may to many field questions in quiz , so that its easier to get and update questions in any quiz .

Shubham
13 Aug, 2023, 09:56

How will i achieve this ?

safwan
13 Aug, 2023, 10:42

Oh I didn't notice you wanted it in cloud. Relationships were introduced in 1.3.x and Cloud is on 1.1.2 so the Relationships feature isn't available on it. That being said, you could manually setup relationships by creating an attribute that keeps track of the related document's ID.

Shubham
13 Aug, 2023, 11:02

like i will store quiz id in every question ? and fetch according to that?

safwan
13 Aug, 2023, 11:04

depends on what you want to do, but yes

Shubham
13 Aug, 2023, 11:06

i am currently migrating from appwrite self hosting to cloud

Shubham
13 Aug, 2023, 11:07

in my self hosting i was using relationship and it works absolutely fine

safwan
13 Aug, 2023, 11:07

that's probably because your self-hosted version is on 1.3.x

Shubham
13 Aug, 2023, 11:08

yes 1.3

Shubham
13 Aug, 2023, 11:09

so for now , what should i do?

safwan
13 Aug, 2023, 11:15

well as I said, if you want to create relationships on cloud, you'll have to manually reference document IDs

Shubham
13 Aug, 2023, 11:59

which will be good option for manual reference document id , storing all question id in an array named questions in every quiz , or storing quiz id in every question , so that i can easily get every question for each quiz easily?

safwan
13 Aug, 2023, 12:35

i guess storing the ids of all questions in an array will be better.

Shubham
13 Aug, 2023, 12:41

and we will paas this array in query in questions to gvet all the data

safwan
13 Aug, 2023, 12:46

yep

Shubham
13 Aug, 2023, 12:53

is it good idea , because in my every quiz almost 200 question will be there , so passing a query with 200 elements araay is good idea or not?

safwan
13 Aug, 2023, 13:08

sure why not?

safwan
15 Aug, 2023, 18:37

[CLOSED] Relationships in Appwrite Cloud

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