
I’m creating a comments system in an app - only signed in users can comment. I want to store each user’s ID with the comment (each comment is a document), then get the user’s name to display on the page.

Either
- Use the Users sdk inside a <:functions:1108648038156746792> cloud function
- Store the ID with the username - can be problematic in case the username has changed, for that you can go with this 👇 approach
2 Collections
1st collection will be
- comment
- date
- user_id
2nd collection will be the user details
- user_id
- user_name
So that's way you'll need to update only the 2nd collection when the user changes is name, and also you can make the second collection accessible without a having to use cloud function.

Seems a bit much - this is just an addon feature that’s not really required - it would just be a bit useful. I guess I’ll just store the name directly
Recommended threads
- Sharing cookies
Hi, I’m using Appwrite Cloud, and I have a setup where my Appwrite backend is hosted on a subdomain (e.g., api.example.com), while my frontend (Next.js app) and...
- Organization not exists anymore
Hello! We have a problem with a cloud database. We are on the Free plan, but after a refresh the site wants me to create a new organisation, and I not see the c...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
