Back

Query.orderAsc on relationship attribute returns server error 500

  • 0
  • Web
Nikky
4 Oct, 2023, 13:59

I have a user and post collections. I have a relationship attribute in usercollection named **posts **and Im trying to get users sorted by highest number of posts (using that posts attribute). I tried this on a non-relationship attribute and it works, but not for relationship attribute.

Im using: Client SDK, Cloud, React

Would really appreciate some help.

TL;DR
The user is experiencing a server error 500 when using the Query.orderAsc on a relationship attribute. The user has a user and post collections, and they are trying to get users sorted by the highest number of posts using the posts attribute. However, this method works for a non-relationship attribute but not for a relationship attribute. The user is using Client SDK, Cloud, and React. Unfortunately, the messages indicate that relationships do not support queries. It is unclear if there is a solution to this issue.
D5
4 Oct, 2023, 14:51

Currently relationships doesn't supports queries

D5
4 Oct, 2023, 14:52

Consequently you will see error when running order, etc queries

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