d123546
d123546

Reputation: 247

AngularFire2 How to retrieve records with certain uid's?

I have two tables in firebase. First table called friend_list and contain the information about current user friends (their uid's). users table consist of users display Name, email address and photo URL.

users
   --- (uid)
      --- displayName
      --- email
      --- photoURL   

How can I retrieve information from users table, with specific user ids? Currently I have two friends in a friendlist. Sorry I'm very newbie in firebase.

Upvotes: 0

Views: 285

Answers (1)

rashidnk
rashidnk

Reputation: 4292

you can Get the object from firebase database

in constructor add public af: AngularFire,

in function

let uid="xxxx" // here is your user id

let item = this.af.object('/users/' + uid, { preserveSnapshot: true });
      item.subscribe(snapshot => {

        console.log(snapshot.val())
        this.userDetails= snapshot.val();
      });

Upvotes: 1

Related Questions