【发布时间】:2018-08-19 12:42:42
【问题描述】:
您能告诉我如何在 Firestore 上进行不区分大小写的查询吗?
例如 Hallway 和 hallway 两者必须相同。但下面的查询会进行精确搜索。即如果 db 有 Hallway 并且我尝试搜索 hallway 然后它显示 no records。
getSpecificTempBudgetGroup(name: string): AngularFirestoreCollection<BudgetGroup> {
return this.fireStore.collection<BudgetGroup>(`members/${this.authenticationProvider.member.id}/budgetGroups`, ref => ref
.where('name', '==', name)
);
}
我也试过toLowerCase()。但没有运气:(有什么线索吗?
getSpecificTempBudgetGroup(name: string): AngularFirestoreCollection<BudgetGroup> {
return this.fireStore.collection<BudgetGroup>(`members/${this.authenticationProvider.member.id}/budgetGroups`, ref => ref
.where('name.toLowerCase()', '==', name.toLowerCase())
);
}
注意:我也看到了可能重复的答案。但它并没有给我的用例提供太多的想法。但是我使用下面提到的 MongoDB 答案获得了有用的信息。
【问题讨论】:
标签: angular typescript firebase ionic3 google-cloud-firestore