Page 1 of 1

User collection unique username

Posted: Sat Feb 01, 2014 12:54 pm
by araskin3i

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


User collection unique username

Posted: Sat Feb 01, 2014 1:39 pm
by Alena Prykhodko

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.