Back

No Relationship Attribute on Cloud

  • 0
  • Databases
  • Cloud
ijay
25 May, 2023, 08:25

am try to get the content and other things

TL;DR
The user is asking about creating relationships in the Appwrite Cloud. The support team suggests creating separate collections for related data and manually referencing the IDs of the related documents. They also mention that there's no harm in creating collections for user-specific data. No specific solution is provided for the issue of making documents downloadable.
safwan
25 May, 2023, 08:26

You can create relationships manually

safwan
25 May, 2023, 08:26

it's more work, but it works just as well.

ijay
25 May, 2023, 08:27

pls how 🤔

safwan
25 May, 2023, 08:30

if you have the following collections, for example:

teams, managers and employees

each teams document can have only one manager, but multiple employees.

So when you create a teams documents, you can use the document ID of the managers doc, and store it in the teams document.

safwan
25 May, 2023, 08:30

Same thing for employees

ijay
25 May, 2023, 08:30

I do front end mostly

Vedsaga
25 May, 2023, 08:30
ijay
25 May, 2023, 08:37

alryt

ijay
25 May, 2023, 09:57

have gone thru d conversion am not getting...

ijay
25 May, 2023, 09:57

pls can u walk me thru

safwan
25 May, 2023, 17:10

What's your database structure like?

ijay
25 May, 2023, 18:01

Goodevening

ijay
25 May, 2023, 18:04
Drake
26 May, 2023, 15:39

No Relationship Attribute on Cloud

safwan
27 May, 2023, 06:25

@ijay please provide more details. What's each collection structured like? What kind of relations do you want to create?

ijay
27 May, 2023, 07:45

@safwan good morning, made it a list instead of relationship☺️, am thinking how I can make d document or recipe the user inputs downloadable if they want.

Majek
27 May, 2023, 08:39

Hi @safwan I have the same issue for example I have a collection that is foodSpot but under that I want to have a one-to-many relationship with foodMenu collection. How do I do this in appwrite cloud do I need to create functions or just use javascript to manipulate the data on my frontend? Thanks

safwan
27 May, 2023, 08:42

@ijay @Majek

There's a few ways you can go about it. Since cloud is on v1.1.2, and no relations aren't supported, you can manually reference the IDs of the related documents

safwan
27 May, 2023, 08:43

So in a collection, you can have an attribute called something like child_id, and store the related document(s)'s id in it

Majek
27 May, 2023, 08:43

How about if I want it to relate to users or the account api? Is it a best practice to create a users collection or just use accounts preferences?

safwan
27 May, 2023, 08:47

If you have to store user-specific data, there's no harm in creating a collection(s) for it. I've seen the devs mention this many times, so it shouldn't be an issue

Majek
27 May, 2023, 09:08

Got it thanks man

D5
27 May, 2023, 09:45

Note that for Hackathon it's required using cloud (1.1.2 without relationships)

D5
27 May, 2023, 09:51

In fact, it's probably the best approach creating a separate collection for users in most cases, since that way you can handle permissions

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