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
- Appwrite project paused
I have github student account. The auth has been paused however the database is working fine. I cant see any option to resume from my console panel. It is just ...
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- Error can not create `tablesdb` event wi...
When i'm trying to add an event with `tablesdb` i get an error message My event value: `tablesdb.mtg-decklist-dev.tables.queue_parsing.rows.*.create` Same err...