简体   繁体   中英

How to join three tables in Firebase Realtime Database?

I have to join three tables in Firebase to fetching the value from it. consider three table A,B, C.Table A contains attribute as(id1,name).Table B contains attribute as(id2,Bname).C contains attribute as(id1,id2).the relation between table A and table B is M to M. I want this query to executed in Firebase.
the query is
select A.id1 from A,B,C where A.id1=C.id1 and B.id2=C.id2 and B.Bname="?"

Thank You!.

The Firebase Realtime database is not like an sql database, it has no idea of joins etc. References are fairly cheap, so maybe create 3 references to the 3 locations that contain the data and run these 3 "queries" and tie the results together to get the final view of the data you want. Something like RxJava might help in running the 3 "queries" and chaining the results together.

Try joining the Firebase Slack channel, it has a lot of good posts on how to structure your Firebase data etc.

https://firebase.community/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM