Firestore 更新的费用是否与写入费用相同?

Are Firestore updates charged the same cost as writes?

根据Firestore documentation,可以在不更新整个文档的情况下更新单个字段:

def update_create_if_missing():
db = firestore.Client()
city_ref = db.collection(u'cities').document(u'BJ')

city_ref.update({
    u'capital': True
}, firestore.CreateIfMissingOption(True))

Firestore 更新是否按写入收费?

是否有 "update if different" 之类的选项,而不是当前缺少的正在更新的选项?

我构建了一个重量级的比价应用程序,每天更新超过 100 万种产品(每种产品都是 Firestore 中的一个文档)。如果我必须在 Firestore 读取之上每天支付 1.000.000 次写入,那将是相当昂贵的。

有没有我可以探索的替代方案?

Firestore 文档更新与写入没有区别。任何更改文档的操作都被视为写入。

为了补充 Doug 的回答,Firestore 将文档创建、更新甚至删除视为可计费的写入事件。阅读更多关于他们的官方文档 here.