I am trying to query a schedule collection where a field in the document = the users id, but i am getting this error: "Function Query.where() requires a valid third argument, but it was undefined."
userId;
uid;
sched: Observable<ScheduleModel[]>;
The ngOnInit()
ngOnInit() {
this.userId = this.afAuth.authState.subscribe(user => {
this.uid = user.uid;
});
this.getSched();
}
getSched() {
this.sched = this.afs.collectionGroup<ScheduleModel>('schedule', ref => ref.where('uid', '==', this.uid)).valueChanges();
}
this.uid in the query is giving me the trouble but: