【发布时间】:2018-11-21 07:18:43
【问题描述】:
根据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 更新是否按写入收费?
是否有诸如“如果不同则更新”之类的选项,而不是当前缺少的选项?
我已经构建了一个相当繁重的价格比较应用程序,每天更新超过 100 万种产品(每个产品都是 Firestore 中的一个文档)。如果我必须在 Firestore 读取之上每天支付 1.000.000 次写入,那将是相当昂贵的。
我可以探索其他选择吗?
【问题讨论】:
标签: google-cloud-datastore google-cloud-firestore