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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -