0

When you do a join in sql, you get information from different tables in a single query. Does the same thing happen on Firebase? Or is it necessary to make subsequent queries?

For example, in the following post:

This.projects = this.af.database.list (`projects`)
   .map (projects => {
     Return projects.map (project => {
       Project.customers.map (customer => {
         This.af.database.list (`customers`)
           .subscribe (c => {
             Customer = c;
           });
       });
       Return project;
     });
   });

Does this query for each mapping, create a real-time connection of each element or just make a query / connection?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • The Firebase Database has no support for server-side joins. Instead you load the additional data by doing extra calls from the client. All traffic between a single client and its Firebase Database goes over a single connection, so performance is not as bad as you may think. See http://stackoverflow.com/questions/35931526/speed-up-fetching-posts-for-my-social-network-app-by-using-query-instead-of-obse/35932786#35932786 – Frank van Puffelen Jul 18 '17 at 13:12
  • @FrankvanPuffelen Excelent! Thank you very much! – Nicolás Batistoni Jul 18 '17 at 13:21

0 Answers0