Seeking some clarification regarding Firebase lists.
I'm attempting to access multiple lists within a single object in order to iterate through them. The structure of the object is as follows:
user : {
playlists: {}, // List 1
joined: {}, // List 2
favorites: {} // List 3
}
While I know I can access each list individually by making three separate requests like this:
firebase.list('user/playlists');
firebase.list('user/joined');
firebase.list('user/favorites');
I am working towards optimizing my code and achieving this in a more efficient manner by using:
firebase.list('user');
And then accessing all the lists it returns inside the user object. However, the issue arises as the lists are returned without keys, only displaying "object." When I use firebase.object('user')
, the keys are indeed accessible.
When requesting 'user' as a list, it looks like this:
https://i.sstatic.net/ZIAtq.png
As depicted, the key is within the object rather than outside of it ($key). How can I access these objects as if the key were the actual key (e.g., user.playlists)?