【发布时间】:2018-12-10 01:57:34
【问题描述】:
是否有另一种方法可以对属于各种集合的多个文档执行一组写入?
类似于官方文档中的多个文档上的批量写入。
Transactions and batched writes on FireStore Docs
举个例子;
WriteBatch batch = db.batch();
// Set the value of 'NYC' in 'cities' collection
DocumentReference nycRef = db.collection("cities").document("NYC");
batch.set(nycRef, map1);
// Set the value of 'ABC' in 'SomeOtherCollection' collection
DocumentReference otherRef = db.collection("SomeOtherCollection").document("ABC");
batch.set(otherRef,map2));
可能在不同的集合上执行批量写入吗?
【问题讨论】:
标签: android firebase google-cloud-firestore