Чтобы получить данные вошедшего в систему пользователя:
[Предполагается, что вам нужны данные вошедшего в систему пользователя]
// get current logged in user details
const user = firebase.auth().currentUser;
// get the branch of the user
const userBranch = firebase.database().ref('/users/'+user.uid);
// retrieve the data from that branch - Remember this is an asynchronous function - it returns promise
userBranch.once('value').then((snapShot)=>{
var userPhoneNo = snapShot.val().phone;
var userPic = snapShot.val().profileImageUrl;
var userName = snapShot.val().username;
});
Ресурс: Ссылка
Если вы хотите узнать больше об асинхронных функциях - Link
О вашей второй проблеме: в JavaScript для Firebase нет расширений для автозаполнения.
Изменить 1:
[Получение всех пользователей из ветки пользователей]
// this will get the whole user branch
const userBranch = firebase.database().ref('/users');
// retrieve the data from the database
userBranch.once('value').then((snapShot)=>{
var userDetaills = snapShot.val()
userDetails.forEach((user)=>{
let userPhone = user.phone;
let userPic = user.profileImageUrl;
let userName = user.username;
// your rest of the logic
});
});