Firebase path reading (true)

Asked

Viewed 26 times

0

I have a question regarding reading in Firebase on paths true. My bank is structured this way:

"servicos"{
    "servico1" : {
             "nome" : "servico1",
             "desc" : "este é  o servico1"
     },
    "servico2" : {
             "nome" : "servico2",
             "desc" : "este é  o servico2"
    }
},

"users":{
    "user1":{
          "nome" : "usuario1",
    },
    "user2":{
          "nome" : "usuario2",
          "tabelas" : {
               "servico1" : true
          }
    }
}

When making a query to user2 i get:

key = user2, values = {nome = usuario2, servico1 = true}

How do I receive the data that is inside servico1 in carrying out this consultation with user2?

Type when consulting user1 wanted to receive the name of servico2 and the desc of servico2.

  • You must perform a new query on the services node searching for the service key 1. firebase does not return this data automatically, using the form "key": true serves to prevent code duplication.

  • Avoid creating identical questions. You asked the exact same question on the one that indicated duplicate

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.