Firebase querying


#1

Hi guys, I am a little bit in trouble with a query on firebase…
As you can see from my db, I need to know the key of the children with a specific “uid” value, which I will pass into the query… How should the query be?


#2

I think Firebase doesn’t recommend the nested database structures like this, unfortunately. But I think it can be done…but it’s preferable to denormalize the data (https://stackoverflow.com/questions/35591023/firebase-query-nested-data#35592448)


#3

I have figured out a way to solve my problem but I need that uid is an array of element…
How can I add element to the uid array ?
I tried this

firebase.setValue(
                                  '/postsNickname/'+userModel.getUserModel().nickname ,
                                  {
                                    'uid':[result.key]
                                  });

but it just shows this and uid has only one value, it doesn’t add a new one, changes the one that it has.

postsNickname {
      Dangrad {

       uid [ result key ]
    }

}