I am working on a registration and login functionality for my webapp.
All registered users have an email and UID in firebase auth db. The UID is used as key in firebase realtime db. The following json structure in firebase realtime db
users
|
|--UID1
|
|---Name:Amanda
|---Surname:Waller
|---age:30
|---email:[email protected]
|--UID2
|
|---Name:MyName
|---Surname:Mysurname
|---age:39
|---email:[email protected]
Now I have an admin user who needs to access other users data , for example the admin wants to search and retrieve the user with email [email protected] , but the JSON key i have chosen is UID , is there a way for an admin user to get UID based on email id of user?Or should I redesign my db? Using email as key doesn't really seem straight forward given that email can contain special characters as stated in the answer to this question: