Firestore不提供类似于SQL的"update where"该命令可一次更新所有内容,因此您将必须:
Firestore doesn't offer a SQL-like "update where" command that updates everything at once, so you will have to:
- 查询要更新的文档
- 迭代每个 DocumentSnapshot 并使用以下方法获取其DocumentReference对象引用属性
- 对于每个文档,更新该字段及其新价值
- Query for the documents to update
- Iterate each DocumentSnapshot and get its DocumentReference object using the reference property
- For each document, update the field with its new value