在添加这些数据之后,我想获得本文档的参考。
有可能吗?
await userCycleCollectionRef.doc().set({
userUid,
startDate,
endDate,
});
答案 0 :(得分:1)
userCycleCollectionRef.doc()
立即返回DocumentReference。
const ref = userCycleCollectionRef.doc()
await ref.set({
userUid,
startDate,
endDate,
});