Your users node is a regular node in Firebase. Thus, the only way to search for elements is either by node name or by priority of node.
If you want to use uid as the name of the node, you can set the email address as priority using setPriority or setWithPriority and then filter using startAt and endAt .
// save new user profile into Firebase so we can // list users, use them in security rules, and show profiles myRef.child('users').child(user.uid).setWithPriority({ displayName: user.displayName, provider: user.provider, provider_id: user.id }, user.email); var userRef = myRef.child('users').startAt(user.email).endAt(user.email);
But if you use only email, you can just save users to their email address to start with:
myRef.child('users').child(user.email).set({ displayName: user.displayName, provider: user.provider, provider_id: user.id }); var userRef = myRef.child('users').child(user.email);
See also:
source share