
I want to get collection data based on UserId field .
getData(){
const data$ = this.fbs.collection(this.trackerData,ref=> ref.where('UserId','==',"WrKDk0XSNjU20FI0EVRvADzvNHz1")).snapshotChanges().subscribe(res=>{
console.log(res);
});
}
if i get data like this i am getting response as :-

but i need response data like :-

You need to transform your stream to get what you want:
getData(userId: string){
return this.fbs.collection(
this.trackerData,
ref=> ref.where('UserId','==',userId)
).snapshotChanges().pipe(
map(action => {
const data = action.payload.data();
const id = action.payload.id;
return { id, ...data };
})
);
}
getData("WrKDk0XSNjU20FI0EVRvADzvNHz1").subscribe(res=> console.log(res));