Hi, I am building a web application that allows the user to change the order of items stored inside a document array attribute.
Now when I pass the new array with updated order then it doesn't work. Appwrite doesn't update the order of array items inside the document.
Also, Please note I am using document relationships.
Document Example.
//User
{
name: "Vishal",
posts: [ //Relationship with a posts collection
"post 1",
"post 2",
"post 3"
]
}
Is there any way I can change the order of posts in the above example?
Unable to change order of items in a document array attribute
You're passing an array of document IDs?
No, i am passing the entire document
Payload and Response Example.
This is an update document API call? Can you copy and paste the JSON here?
Also, can you share the details of the collections so we know all the attribute configurations?
These are the profile collection attributes
I have a unique profile for each user and I am updating the profile everytime anything changes
Links Collection Attributes
I have removed some data like createdAt and UpdatedAt to just have some imp fields
Can you provide the details of the links attribute?
@Steven Please check this
I meant the details of the attribute in the profile collection. So I can see the type of relationship and whatnot
I'll have to try and reproduce this tomorrow
okay so i was sort of able to reproduce the problem...the order was off even when i created the document and the order was incorrect, but it wasn't incorrect the same way yours was...
would you be able to create an issue for the problem?
thank you for opening
Recommended threads
- IMPORTANT! SOC-2 Request Failing
Issue requesting SOC-2. If tried other/private browser as well as filling in optional fields.
- Can you suppress row $meta data?
When using listRows with a 'select' query to limit the response [for performance], I'm still getting extra columns (eg. `$id`, `$sequence`, `$createdAt`, `$upda...
- How can I disable client-side account re...
Hi everyone! I’m currently building a game backend using Appwrite, and I’d like to prevent users from creating new accounts directly through the client. My go...