I am trying to obtain a single element (path) for a specific user within Firestore using angularfire2 / angular 6.
I currently store the image into the Firestore database. I then add a record into the Firestore database with the users UID and path of the file.
I am attempting to get a single item (path) by looking up the users UID. I know how to use queries in Firestore. I want to get the path WITHOUT a subscription.
Anyone know how to pull data from Firestore without a subscription?
getUserImage(uid) {
const imageRef = this.afs.collection('/users', ref => ref.where('userUID', '==', uid));
return imageRef.snapshotChanges().pipe(map(results1 => {
return results1.map((x) => {
return x.payload.doc.data() as User;
});
}));
}
Example: If I am pulling information about a single user; Can i do this without a subscription?