
i got a getDocument that lists data from the user (username, password, id.....)
so my question is how do i exclude the password so it doesnt get listed out?
my code:
const result = await database.getDocument(
DATABASE_ID,
USERS_COLLECTION_ID,
userId.documents[0].$id
);

ps. the response in the console:
{
username: 'BBBB BBBB',
password: 'x',
'$id': '32923',
'$createdAt': '2025-05-03T15:26:53.449+00:00',
'$updatedAt': '2025-05-03T15:26:53.449+00:00',
'$permissions': [],
'$databaseId': '680a2e8b002c2db36574',
'$collectionId': '680a2ec200001dd95365'
}
i dont want to have the password in response

Use Query.select Add the attribute you want to fetch

Query.select(["name", "title"])
You would have to use list document i guess.....

Btw Having password in the collection. Are you sure its ok? Why not use the auth?
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...
