I am using react-native-firebase, and I generally want to use custom keys on the table's JSON objects. I have searched and I know that I can use the set
method instead of push
, to accomplish that. My problem is when creating new users.
React-native-firebase uses the function signInWithEmailAndPassword(email,password)
which automatically creates a new user with a random ID like 9dBqfh5yfbd2dMGIieIe3tPs2ba2
. Now since I am used to mySQL database structure, instinctively I would like to use either a numeric key, or even the username as an ID. However I am not really sure if the corect way to store the uid on the database is on the object's key, or inside the object on a uid property.
Is there any way except from using the admin SDK which requires of course a server and cannot run natively on my application to achieve this?