I would like to ensure that before attempting to sign up a displayName
is unique. I have a user table like this:
$uid: {
..data..
displayName: 'noob839',
}
I have done an ".indexOn": ["displayName"]
to optimise this, now I need to (from the client) check every user to see if displayName
value is already taken.
It is very important that the current user can only read that field of another user.
Is this a recommended approach? How would I go about iterating over every user to see if the display name is unique? Thanks in advance.
P.S. Since we cannot attach data to users we must make a seperate user object which complicates app design since it adds another point of failure for sign ups, and data retrieval (a two step process). That's a shame!