How can we manage to give unique names to user so that no other user can get the same or earlier taken name.
either just create random strings or ID.unique()
No I want to go with user's provided names
technical when a user is created it already assigns unique id
so even if the names are same it's dosen't matter
I wanted to let user create custom names so that they can get custom URL to accounts
map this to collection then and check every time before assigning the user name that if this already exist
like a create a custom name -> create a document with name and who created it(user)
then if query everytime a user is creating a custom name check if it's already exists or not
This could be a solution but if Appwrite gives us access to Edit Document's or User's ID then will be simple for us.
if the is property like unique in attribute that would be more easy
like in sql
@Steven I think we should add support for editing document's ID's this way we can handle unique user's names
you don't have to editing document's ID just create the document with custom name
document id as custom name so that no other user can create same document
@Hassanmrwt i think this does meet your requirement
Yes this also does but I want user to edit their custom names any time or after specific time.
With this we can control things in registration time but later when user want to change his user name then?
store(in response)/get the prev document -> delete that document -> create a new one with new name as docId (check if exist or not) and whatever with previous data that was present in at that time with that prev response
``
this opens a big can of worms. For example, they would lose access to things because the permission on some document was read("user:old_id")
for your case, you might want to use a separate attribute for username
Recommended threads
- Auth not working on expo react native
I'm trying to launch a development server with expo go and appwrite as a backend. On my windows pc, I've got a local docker instance of appwrite running as my b...
- createMembership is not sending email wi...
Parameters should be correct. Account and Membership are successfully created. I have a next.js project with localhost origin allowed. I checked spam etc. i...
- Bulk delete failed with 401
- I created a transaction to bulk delete rows in a table has `done` equal `true` follow documentation. But when run, it returns 401 unauthorized error as screen...