Back

Attributes missing from documents retrieved through a relationship.

  • 0
  • Self Hosted
  • Databases
elnur
13 Apr, 2024, 13:51

So consider this scenario:

Collection Users has a two-way relationship with Collection Products.

So each User document can reference many Product documents.

When I go an retrieve the User document I don't receive any of the other relationship attributes that a Product document might have.

Eg if Products Collection had a relationship with the Images collection, we would not get that when retrieving the User document. However, if I retrieve the product document directly I get all the attributes.

Is this expected?

TL;DR
Developers are not receiving relationship attributes from related documents when retrieving a User document in a two-way relationship with Products. This behavior is expected due to the current implementation. To get all attributes, developers need to retrieve the Product document directly.
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