The Walrus
The Walrus

Reputation: 1208

How to iterate through Objects of Objects in firebase?

This is my firebase data structure below

enter image description here

I know how to iterate bymonth but how can i iterate through each individual month and then access something inside the id -Kukj etc. These ids are generated randomly so I need a way to be able to access them and then there contents inside. any ideas?

Upvotes: 0

Views: 80

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 600126

To iterate through the children of a node, use DataSnapshot.forEach(). Since this itself returns another snapshot, you can use it to iterate structures arbitrarily deep.

Upvotes: 1

Related Questions