Could you tell me how can I do case insensitive query on Firestore?
e.g. Hallway
and hallway
both must be the same. But below query does exact search. i.e. If db has Hallway
and I tried to search hallway
then it shows no records
.
getSpecificTempBudgetGroup(name: string): AngularFirestoreCollection<BudgetGroup> {
return this.fireStore.collection<BudgetGroup>(`members/${this.authenticationProvider.member.id}/budgetGroups`, ref => ref
.where('name', '==', name)
);
}
I have tried with toLowerCase()
too. But no luck :( Any clue?
getSpecificTempBudgetGroup(name: string): AngularFirestoreCollection<BudgetGroup> {
return this.fireStore.collection<BudgetGroup>(`members/${this.authenticationProvider.member.id}/budgetGroups`, ref => ref
.where('name.toLowerCase()', '==', name.toLowerCase())
);
}
Note: I saw the possible duplicate answer too. But it didn't give that much of idea to my use case. But I got useful info using MongoDB answer which I have mentioned below.