Doubts how to "read" data in firebase-database

1

Assuming I have this structure in the database

    
userId : {
  Messages : {
   SenderID : {
      PushID: {
         "msg": "Mensagem"
      }
   }
}

I'm using this code to "read" everything inside the "userID"

dbRef.child(user.uid + "/Messages").on("value", function(snap){
                        
                        obj.html(JSON.stringify(snap.val(), null, 3));
                    });

but the return I need is just the "msg": "message"

I would like to know how to return only what I need, can anyone help me? thanks from ja

    
asked by anonymous 02.05.2018 / 01:35

0 answers