Back

relation

  • 0
  • Databases
  • Web
wings of ice
5 Mar, 2024, 12:01

is it normal to have n/a as user and not the id of the user in my many to one collection ?

TL;DR
Developers discussing an issue where user data is null when retrieving it from listDocuments. There seems to be a problem with updating the data correctly. They mention having a many-to-one relationship between Todos and Users. The issue might relate to how the relationship is set up or data being passed.
D5
5 Mar, 2024, 12:04

How's that being created?

D5
5 Mar, 2024, 12:04

I mean, what the code to create it?

D5
5 Mar, 2024, 12:04

And what's the relationship?

wings of ice
5 Mar, 2024, 12:04
wings of ice
5 Mar, 2024, 12:04

i have a todo collection and a user collection

wings of ice
5 Mar, 2024, 12:05

and i made a many to one in the todo to the user with 2 way relationship

wings of ice
5 Mar, 2024, 12:06
wings of ice
5 Mar, 2024, 12:06

when i try to get the data it works

wings of ice
5 Mar, 2024, 12:06

it gives me the data related to the user

wings of ice
5 Mar, 2024, 12:06

but the problem comes when i try to update the data

wings of ice
5 Mar, 2024, 12:06
wings of ice
5 Mar, 2024, 12:06

the newtodo have user in it with the right id

wings of ice
5 Mar, 2024, 12:07
ideclon
5 Mar, 2024, 12:50

What’s in newtodo here?

wings of ice
5 Mar, 2024, 12:51

this

ideclon
5 Mar, 2024, 12:53

And that came from listDocuments()/getDocument()?

wings of ice
5 Mar, 2024, 12:56

the problem is that when i try get the data from listDocuments it gives me the right data but the user is null

wings of ice
5 Mar, 2024, 12:56

so that's what's confusing me af

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