【发布时间】:2020-04-22 11:56:24
【问题描述】:
从documentation 中的Android 示例中,很明显我们可以在单个update() 调用中更新多个字段。我想知道,这个调用需要一次写入还是 n 次写入(n = 更新的字段数)?
// Assume the document contains:
// {
// name: "Frank",
// favorites: { food: "Pizza", color: "Blue", subject: "recess" }
// age: 12
// }
//
// To update age and favorite color:
db.collection("users").document("frank")
.update(
"age", 13,
"favorites.color", "Red"
);
【问题讨论】:
标签: android firebase google-cloud-firestore