Back

how sort array of related objects?

  • 0
  • Databases
  • Web
  • Storage
YBFxd
13 Jul, 2023, 17:02

I have a relationship between Recap and Repetition. In Recap, there is an array of Repetition. Repetition objects have a key called 'startDate'. How can I get this array sorted by 'startDate'?

TL;DR
The user wants to sort an array of related objects. The documentation does not have information on how to do this. Queries on relationships are not currently supported. They can use order queries to fetch the objects sorted. To sort the array of Repetition objects by the 'startDate' key, they can use order queries.
Drake
13 Jul, 2023, 17:07

Queries on relationships are not supported at the moment. See https://appwrite.io/docs/databases-relationships#limitations

If you want to fetch Repitition objects sorted, use one of the order queries. See https://appwrite.io/docs/queries#query-class

YBFxd
13 Jul, 2023, 17:09

Can I some how sorts the array of related object by functions?

Drake
13 Jul, 2023, 17:11

you would have to do it yourself

YBFxd
13 Jul, 2023, 17:12

Any idea where to look in documentation?

Drake
13 Jul, 2023, 17:14

there's no other documentation about this...

YBFxd
13 Jul, 2023, 17:14

Thanks

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