我正在研究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"
}
}
}
]
}
}
}
}