I'm trying to create a simple system that allows users to create an account with info that they provided. Right now, I store all the data in a Collection users
which has some Documents that represents users.
I'd like to keep some sensitive data of the user, such as the email address and phone number, private. In Firebase Database I would've created something like this:
users: {
uid: {
public_info:...
private_info:...
}
}
Protecting the data in here is pretty straight forward. I would simply write different rule sets for the private_info
and public_info
.
How would something like this be achieved in Firestore?
Use different top-level collections for user public and private data, and set their rules appropriately.