Back

AppwriteException: Invalid query: cannot query on virtual relationship attribute

  • 0
  • Databases
  • React Native
ConCrist
6 Jun, 2024, 01:50

Hi, I hope y'all are good.

How I can read data from the database according to an attribute of the collection which has a many to many relationship with another collection? I don't find how resolve this via the documentation. For example, I want to get all videos saved by the user. for this I created a "saved" attribute in the videos collection and this attribute has a many to many relationship with the "users" collection. Triyng with "getVideoSaved" function in the image.

TL;DR
Issue: Trying to query data based on a virtual relationship attribute causing an AppwriteException. Solution: The error occurs because you cannot query on virtual relationship attributes. Instead, consider restructuring your data model or using alternative methods to achieve the desired outcome.
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