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
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.
- Deploy function not working - 503
Hellon i get this error message, when i try to deploy a new version of a function <html><body><h1>503 Service Unavailable</h1>No server is available to handle...