Firebase synchronize company data only

0

I have about 200 companies that will use the app (android). But I do not want firebase to synchronize all the data of all the companies.

In the example, I want all users in company 1 to only synchronize the sales of company 1.

{
  "ventas": [
    {
      "empresa": "empresa 1",
      "producto": "producto 1",
      "usuario": "usuario 1"
    },
    {
      "empresa": "empresa 2",
      "producto": "producto 2",
      "usuario": "usuario 2"
    },
    {
      "empresa": "empresa 1",
      "producto": "producto 3",
      "usuario": "usuario 3"
    }]
}
    
asked by danielctf 04.10.2016 в 17:27
source

1 answer

0

For this case you could apply a filter and only return the sales that comply with the condition of being of the company that consults.

But if your grouper is the companies I think it would make more sense to have a model where the node is the companies and each company has a node with its sales.

    
answered by 30.05.2017 в 19:57