0

How can I get next key value (User03) continue from last recent key (User02) like image below: enter image description here

Diego Venâncio
  • 5,698
  • 2
  • 49
  • 68
Kanzt
  • 135
  • 1
  • 6
  • 13

1 Answers1

0

To know the next key in this sequence, you will need to first load all the current keys.

This is one of the many reasons Firebase recommends against using arrays, since such an operation doesn't scale well, and will only work while the user is connected to the database. I recommend reading best practices for arrays in Firebase and what are Firebase push IDs.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807