zombikaaOriginal post
Rank 3: Container
Hi, can i use account.get if i want to check if a user exists ? in a function
Summary
Developers can use `users.get(USER_ID)` to check if a user exists, instead of `account.get()`.
Votes
0
Replies
4
Participants
Unknown
Messages
5
Rank 3: Container
Hi, can i use account.get if i want to check if a user exists ? in a function
No, account.get() gets the currently logged in user.
You would want to use users.get(USER_ID)
https://appwrite.io/docs/references/cloud/server-nodejs/users#get
Rank 3: Container
thank you so much, ill try it :)
Rank 3: Container
and can i somehow search by email?
sure, try
const res = users.list([ Query.equal('email', 'USER_EMAIL')]);
const user = res.users[0]