nosql - Firebase Rules Flat structure for stores, user, products relationship -
i try build firebase datastructure. come sql world , have problems understanding nosql datastructur.
i have datastructure stores. each store has datafields storename, address , on. store should have users object storing users work in store , able add new products , modify them. there dataobject stores products , products should have relation users(stores). can give me hint how build flat possible?
my data structure right now:
"rules": { "users": { "$uid": { ".write": "auth !== null && auth.uid === $uid", ".read": "auth !== null && auth.provider === 'password'" } }, "products": { "$uid": { ".write": "auth !== null && auth.uid === $uid", ".read": true } }, "stores": { "$uid": { ".write": "auth !== null && auth.uid === $uid", ".read": true } } }
thanks
Comments
Post a Comment