In the data base, the JSON structure incluse the user ID and all the data. Like this example:
{
“UsersData” : {
“JXhbigMqPsOGEg9T99WXXXXXXXX” : { “outputs” : {
“digital” : {
“2” : 0,
“12” : 1
}, …
But If we were two or more users that want to access the exact same data base, where I should include the UUID of the other users ?
Thanks for your answer…
Hi.
If you want to have multiple users accessing the database, you would need to structure it in a different way and then, add access via the database rules.
For example, for multiple users, I recommend removing the node with the user UID from the database structure because all users will be publishing on the same nodes.
Then, on the database rules, you specify that you only want to provide access to those users as follows:
{
"rules": {
".read": ""auth.uid === 'REPLACE_WITH_YOUR_USER_UID' || auth.uid === 'REPLACE_WITH_USER_UID2'",
".write": "auth.uid === 'REPLACE_WITH_YOUR_USER_UID' || auth.uid === 'REPLACE_WITH_USER_UID2'"
}
}
I hope this helps.
Regards,
Sara