
Appwrite relationships are great. I have a relationship with one to many. So one Document stores multiple ids. But is there a way to (programatically) reorder this list?

Not sure what exactly you mean. Do you want to re-order the way they're returned?

yep. For example, that the current 3rd value is becoming the 2nd.


So you want to keep the order of the relationships the way they are inserted? Or if you edit them from the other side into:
artictleBlocks: [id1, id2, id3]
, to have them returned in that order? And if you add a new block id4
that is linked to the Article to be added at the end, resulting in id1, id2, id3, id4
?

I'm not sure of how relations fully work, but I'm pretty sure that the order of the IDs in the relationship are chronological. So whenever a child is created, it gets attached to the end of the list. I'd like to assume that's the expected behaviour, as you can filter/sort your lists on the client side

why would you like to do it? order generally doesn't have any impact

Yeah, they are returned based on their creation time. I was testing it now.

I guess he wants to keep them in his defined order, without needing a special attribute for it such as having on each ArticleBlocks attribute int order
.

Aha that makes sense. @Tomic R. you should look at this idea of using an integer attribute order
to help you sort them better.
Recommended threads
- Flutter OAuth2 Google does not return to...
When the flow starts, the browser opens, I select an account, and it keeps showing: """ Page not found The page you're looking for doesn't exist. `general_rout...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
- list() is very slow; eventually shows no...
When I use the web browser to view the collections in my database, the documents they contain are normally displayed within a few seconds. For a few days now, h...
