araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

User collection unique username

Is it possible to ensure when the user signs up to our app that the userName is unique? I noticed that the field userName in the Users collection is not a key field and therefore allows duplicate entries.

Do I need to do a query first or is there a way to set this field to be 'unique'?

Regards,

Alon

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

User collection unique username

Hello!

There is no way to do it automatically. You would need to think of your app logic and do some coding to implement that algorithm.
You'll need to query to collection and check whether such user exists or not.

Return to “Issues”