Issue
My challenge is in the collection reference in my function. My collection is like 'users/user.id/mat'is this the correct way of doing this. Please help
filter(){
this.mat = this.afs.collection('users/user.id/mat', ref => ref.where('name','==','testUID')).valueChanges()
console.log(this.mat);
return this.mat
}
Solution
You have to subscribe to the valueChanges()
:
this.afs.collection('users/user.id/mat', ref => ref.where('name','==','testUID')).valueChanges().subscribe(response =>{
if(response){
console.log(response);
}
});
Answered By - Prashant Pimpale
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.