Rank 2: Process
How can we manage to give unique names to user so that no other user can get the same or earlier taken name.
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
How can we manage to give unique names to user so that no other user can get the same or earlier taken name.
Rank 2: Process
either just create random strings or ID.unique()
Rank 2: Process
Rank 2: Process
No I want to go with user's provided names
Rank 2: Process
technical when a user is created it already assigns unique id
Rank 2: Process
so even if the names are same it's dosen't matter
Rank 2: Process
I wanted to let user create custom names so that they can get custom URL to accounts
Rank 2: Process
map this to collection then and check every time before assigning the user name that if this already exist
Rank 2: Process
like a create a custom name -> create a document with name and who created it(user)
Rank 2: Process
then if query everytime a user is creating a custom name check if it's already exists or not
Rank 2: Process
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.
Rank 2: Process
if the is property like unique in attribute that would be more easy
Rank 2: Process
like in sql
Rank 2: Process
@Steven I think we should add support for editing document's ID's this way we can handle unique user's names
Rank 2: Process
you don't have to editing document's ID just create the document with custom name
Rank 2: Process
Rank 2: Process
Rank 2: Process
document id as custom name so that no other user can create same document
Rank 2: Process
@Hassanmrwt i think this does meet your requirement
Rank 2: Process
Yes this also does but I want user to edit their custom names any time or after specific time.
Rank 2: Process
With this we can control things in registration time but later when user want to change his user name then?
Rank 2: Process
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
Rank 2: Process
``
Admin
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")
Admin
for your case, you might want to use a separate attribute for username