Hello, how can I check if a name already exist?
I think to do something like this you would have to use the server side sdk and use the list users endpoint with a query of the persons name, and if it returns at least 1 record then a user exists with that name.
so theres no way to do that within the flutter app?
I don't think so, the only other thing I can think of is if you were to set the ID of a user to their name, then Appwrite itself would prevent duplicates.
But that would also prevent you from allowing name changes.
and what if I would save the name as a preference?
different users can have the same perference, so that wouldn't do anything for you
can you use collections in flutter ?
Like they've suggested, you could create a new collection to store additonal user data and use that to check for duplicates
by storing they emails
yeah, but can you compare it there?
You cannot get any other users account data from the client sdk
Lists?
i mean the collections in appwrite cloud
in the database
maybe editing the appwrite source for self hosting would be the one with best performance?
I would not recommend exposing the endpoint to fetch other users data to the client.
can I use the restapi to list the users?
https://appwrite.io/docs/references/cloud/server-rest/users
Sure, but you'll have to expose your api key.
I believe you would this be pretty much be exposing this data to anyone who wanted to look.
Which I would not recommend :P
I would go the route that Shadow had mentioned, create a seperate collection to store some additonal user data, key the collection on the user id and then you can easily do a lookup on that collection and see if a name already exists or not.
Recommended threads
- Error with realtime channels
I'm performing a subscription to realtime channels, and after a few seconds I get an exception with this error: {\"type\":\"error\",\"data\":{\"code\":1008,\"me...
- Which flutter SDK version for Self Hoste...
Hi all, Is there a good way to figure out which version of flutter SDK and Dart SDK is current for latest available self-hosted 1.8.0 ? I know new features are...
- redirect_uri errors on flutter client
Hi all, I'm using the flutter client for my app to do appwrite auth and use the JWTs to send to my backend. When I try to sign in with SSO, I get this: https:/...