Query Firebase data on multiple reference IDs -


i have data structured below in firebase. there users having list of groups have access to. wonder how make firebase query fetching groups $refids equal once within "groups" section in users. many-to-may relationship. make list of groups user member of.

is option fetch them 1 one or there better solution?

users: {     "$uid": {         name: "john doe",         groups: {             "$refid": true,             "$refid": true         }     },     "$uid": {         name: "jane doe",         groups: {             "$refid": true         }     } }, groups: {     "$refid": {         title: "group 1"     },     "$refid": {         title: "group 2"     } } 

as suggested, loading in groups user node , iterating on each group.

another option different group structure

groups: {     "$refid": {         title: "group 1"         uid0: true         uid1: true     },     "$refid": {         title: "group 2"         uid1: true         uid3: true     } } 

you query groups node uid1: true, return groups uid1 part of; group 1 , group 2 in case.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -