2 Replies - 208 Views - Last Post: 05 November 2017 - 11:03 AM Rate Topic: -----

#1 lastpeony  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 14-October 17

how do i reach child data with its key?(angularfire2/firebase)

Posted 05 November 2017 - 02:28 AM

how do i reach child data with its key?.i guess i need to use snapshotchanges to also get key with data but i couldnt manage it.for example in this picture i need to retrieve pixilat pixilong data with their msgkey

Posted Image

because if pixilat pixilong is equal to something in programme i wanna remove that key entirely. thanks
Is This A Good Question/Topic? 0
  • +

Replies To: how do i reach child data with its key?(angularfire2/firebase)

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5073
  • View blog
  • Posts: 13,697
  • Joined: 18-April 07

Re: how do i reach child data with its key?(angularfire2/firebase)

Posted 05 November 2017 - 10:35 AM

You can access elements using a key by using the child() method.

database.ref('pixidata').child('Ky1lfGhN6ht7')



Of course you then have to fetch the data. For that you can take a look at the .once() method or setup a listener like addChildEventListener and get the value from the DataSnapshot object.
Was This Post Helpful? 0
  • +
  • -

#3 lastpeony  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 14-October 17

Re: how do i reach child data with its key?(angularfire2/firebase)

Posted 05 November 2017 - 11:03 AM

i didnt know the key but anyway i solved the problem
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1