firebase - 如何在 Firestore REST API runQuery 中对复合过滤器使用“或”操作
问题描述
我正在研究Firestore REST API runQuery
我想获得所有符合此条件的文件:
college == 'CUHK' OR college == 'HKU'
我在复合过滤器的操作中寻找"OR"
,不幸的是它不存在
(Firestore Official Documentation)
下面的查询有什么替代方法吗?(我想要但不存在的东西)
{
"structuredQuery": {
"from": [
{
"collectionId": "participants"
}
],
"where": {
"compositeFilter": {
"op": "OR", // <- what I want
"filters": [
{
"fieldFilter": {
"field": {
"fieldPath": "college"
},
"op": "EQUAL",
"value": {
"stringValue": "CUHK"
}
}
}, // OR
{
"fieldFilter": {
"field": {
"fieldPath": "college"
},
"op": "EQUAL",
"value": {
"stringValue": "HKU"
}
}
}
]
}
}
}
}
解决方案
推荐阅读
- pandas - 转换 Pandas 数据框偶数列的 DateFormat
- oop - 插件设计模式解释(如 Martin Fowler 所述)
- node.js - Google Stackdriver 错误报告 API - 包含自定义数据
- jquery - 获取选择了哪些单选按钮并在 Asp.net MVC 中隐藏输入(可能使用 jquery?)
- uinavigationcontroller - 通过 UINavigationController 将数据传递给 UIViewController
- reactjs - 我以相同的方式安装了多个库,并且 React 正在注册除一个之外的所有库。为什么它找不到这个特定的模块?
- vba - VBA - 通过多列重复电子邮件功能
- c# - UWP NavigationView - 使用 VisualStudio GUI 添加菜单项
- python - 基于用户输入的菱形
- c++ - 是否有一个 Qt 小部件看起来像一个标签来显示文本,但如果双击也可以编辑?