When registering new email/password type users, I need to make user that the displayName
that they enter does not already exist in my Realtime Database before
You'd use Firebase queries for that:
var users = firebase.database().ref('users');
var joes = users.orderByChild('displayName').equalTo('Joe');
joes.once('value', function(snapshot) {
console.log('A Joe does '+(snapshot.exists()?'':'not ')+' exist')
});
Don't forget to define an index on users
:
{
"rules": {
"users": {
".indexOn": "displayName"
}
}
}