
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
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
