I would like to create a comments section and store the comments as follows:
[
{
"name" = '',
"comment" = '',
"created" = Date.now()
}
]
and later would like to get the data as comments[0]?.name. I would like to store this as an array in the appwrite document. Is this possible?
Are you on Appwrite Cloud?
I highly recommend creating a collection of comments.
yes
Ok... but how am I supposed to link that to the documents?
like
each ducmunet in the posts will also have a document in the comments
but how am I supposed to like the,?
like in supabase
In Appwrite 1.3, we added built-in support for relationships. Unfortunately, Appwrite cloud is currently on version 1.1.2.
For now, you can have an array of strings in posts and put the document IDs of the related comments.
Or you can put the ID of the post in the comment and then you can fetch all the comments for that post.
okay
Recommended threads
- Project paused?
Hello, I have two Appwrite projects and I can not resume them for some reason. I'm using the free plan, and I saw in the pricing page that 2 free projects are a...
- Help
- Python TablesDB Rework
Hi, i starting to rework some older functions to TablesDB list_rows Method. I used list_documents with a resultset with worked fine. Now i tried to get all rows...