Here is the User collection within my firestore database:
I am trying to use the below method to only return Users where isMechanic === false:
private _mechanics = new BehaviorSubject<User[]>([]);
get mechanics() {
return this._mechanics.asObservable();
}
return of(
firebase.firestore().collection("users").where("isMechanic", "==", "false")
.get()
.then((docs) => {
const data = []
docs.forEach((doc) => {
data.push(doc);
});
this._mechanics.next(data)
console.log('Mechanics in UsersService:', this._mechanics);
console.log('Mechanics in UsersService:', this.mechanics);
}).catch((err) => {
console.log(err);
})
);
No records are currently beingWhen this method is called, an empty array is logged to the console. So no records are being returned even though (as per screenshot) isMechanic is false for this record.
Can someone please tell me what changes are required for this function to work as expected?

isMechanicin users?isMechanicisn't a property on the objects in the array. Have you tried looking in the nested properties to see where the property is? For example, inmetadata. I don't use Firestore, but I imagine this should be documented in the official documentation?