Back

How to query in Database Relationship

  • 0
  • Databases
  • Cloud
Mosh Ontong
25 Sep, 2023, 04:01

I have collection named ServiceFavorite it have two attributes service (have relation with my service collection) and user (have relations with my userProfile collection). Now I have method that getAllFavorites of the particular user. So how can I query that the user is equal to this current user.

TL;DR
The user is having trouble querying relationships in a database. The current database does not support querying relationships. They have a collection called "ServiceFavorite" that stores favorites of different users and they want to use a query to only get documents owned by the current user. They are wondering if the related items should appear in the results if they fetch the user profile. They also mention that the "ServiceFavorite" collection has attributes "service" (related to the service collection) and "user" (related to the userProfile collection). They ask how they can query to get the favorites of the current user. Unfortunately, no solution is provided in the support
Drake
25 Sep, 2023, 04:05

Shouldn't the related stuff appear in the results if you fetch the user profile?

Mosh Ontong
25 Sep, 2023, 04:08

I have a ServiceFavorite collection it will store all the favorites of the different users. That is why I want to use Query.equal to get only documents that is owned by the current user

Drake
25 Sep, 2023, 04:09

Currently, querying relationships is not supported: https://appwrite.io/docs/databases-relationships#query

Mosh Ontong
25 Sep, 2023, 04:09

Ohh I seee that is sad

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