score:4

const userRef = firebase.database().ref('users');
userRef.on('value', (snapshot) => {
  let newUserState = [];
  snapshot.forEach(data => {
    const dataVal = data.val()
    newUsersState.push({
      id: data.key,
      name: dataVal.name,
      account: dataVal.account
    })
  })
})

Related Query

More Query from same tag