I have below code in angular service using firestore, there is not syntax error and it's working fine,
The problem is the returning type, since I am using take(1)
I want the return type be Observable<Client>
fetchByUserId(uid: string): Observable<Array<Client>> {
return this.collection(ref => ref.where(`users.${uid}`, '>', 0))
.valueChanges()
.take(1);
}
I tried using .first()
but problem is by using first
observable completes and I want to keep streaming.