我似乎无法在 Cloud 函数中组合两个“where”子句(Firestore 文档未更新)。如果有人能指出我哪里出错了,我将不胜感激。
return admin.firestore().collection('/events/')
// .where('data', '<', new Date()).where('published', '==', true) // Doesn't work (multiple)
// .where('data', '<', new Date()) // Works (single)
// .where('published', '==', true) // Works (single)
.get().then(
(result: any) => {
if (result.size > 0) {
result.forEach(async (doc: any) => {
await doc.ref.update({
'published': false,
})
await sgMail.send(msg);
})
}
提前致谢!
慕哥6287543
相关分类