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
- Issue with relations on database
I'm creating a food ordering website for businesses. I'm having issues with the relations on my database I attached the attributes for the collections I'm hav...
- The current user is not authorized to pe...
I want to create a document associated with user after log in with OAuth. The user were logged in, but Appwrite said user is unauthorized. User is logged in wi...
- self-hosted auth: /v1/account 404 on saf...
Project created in React/Next.js, Appwrite version 1.6.0. Authentication works in all browsers except Safari (ios), where an attempt to connect to {endpoint}/v1...