Skip to content
Back

Possible to query rows that have a certain relationship?

  • 0
  • Databases
UCYT5040
23 Nov, 2025, 14:21

I have a one way relationship relating VolunteerReport to User.

I then want to list all VolunteerReports related to User.

I don't think I can just query the user, since the relationship is one-way, so the user doesn't have that relationship on their end.

Where volunteer is the relationship column: I tried Query.equal('volunteer', userId) And Query.equal('volunteer.$id', userId) Neither worked.

And I can't find any documentation on this.

What should I do?

In the meantime, I am just fetching all and manually filtering. Very inefficient though.

TL;DR
- Developer wants to query rows with a specific relationship (`VolunteerReport` and `User`) - Tried using `Query.equal('volunteer', userId)` without success - Problem was not awaiting `listRows` call - A one-way relationship from `VolunteerReport` to `User` - Manually filtering rows as a temporary solution.
UCYT5040
23 Nov, 2025, 14:24

Ah, I just figured it out. Query.equal('volunteer', userId) works fine, I just didn't await my listRows call 😭

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