【发布时间】:2020-07-02 21:07:44
【问题描述】:
我正在为我的应用程序使用 React Native,我正在执行一个批处理事务,但在我设置的第二个批处理中失败了:
let rriNshpiUserCollection = await firestore().collection('myDoc').doc(login_uid);
let privateDoc = await firestore().collection('myDoc').doc(login_uid).collection('private');
let batch = firestore().batch();
batch.update(rriNshpiUserCollection, {
addCoord: this.state.location,
last_location: this.state.location,
device_id: this.state.device_id,
update_time: timeStamp,
act: 1
});
batch.set(privateDoc, { // its failing here
loc: this.state.location,
time: timeStamp
});
错误:
错误:firebase.firestore.batch().set(*) 'documentRef' 预期的 DocumentReference 实例。
你能说出这段代码有什么问题吗?
【问题讨论】:
标签: javascript firebase react-native google-cloud-firestore