title: Firebase unique field value
body: <p>So I found this answer on how to create a unique field in Firebase: <a href="https://stackoverflow.com/questions/35243492/firebase-android-make-username-unique">Firebase android : make username unique</a></p>
  
  <p>But my question is, if I have multiple unique fields (in different collections) does that mean I have to create multiple <code>usernames</code> collections that will hold all my unique fields.</p>
  
  <p>Here is an example. Say I have two collections <code>users</code> and <code>groups</code>. In my users, I have an <code>email</code> field that must be unique. In my <code>groups</code> I have an <code>address</code> field that must be unique. So does that mean (according to the above answer) I need to have these collections in my root:</p>
  
  <ul>
  <li>users</li>
  <li>uniqueUserEmails</li>
  <li>groups</li>
  <li>uniqueGroupAddresses</li>
  </ul>
  
  <p>This seems horrible? Is this a big downside to nosql vs sql? In sql it would be so easy to say <code>UNIQUE</code> in the field(column) creation</p>