Trying to understand Firebase's handling of entries, I've been attempting to retrieve all keys from a child node.
<div v-for="item in TeamArray">
{{item['.key']}}
</div>
Retrieving the keys from the HTML section works fine, but I want to store all keys in an array. When I try to save the keys in an array rather than just displaying them, Vue enters an infinite loop and populates the array with duplicate values.
<div v-for="item in TeamArray">
{{Save_Keys(item['.key'])}}
</div>
While TeamArray can be iterated in HTML, I figured it could also be done the same way with a foreach loop.
Get_Keys: function () {
this.$firebaseRefs.TeamArray.forEach(function(key){
team_key_list.push(key['.key']);
});
for(let i = 0; i < team_key_list.length; i++)
console.log(team_key_list[i])
}
However, I encounter an error stating that forEach is not a function for TeamArray.
How does Firebase operate in this scenario? Does Vue allow for iteration in HTML but require something different in JavaScript?
Thank you