[英]Can I get the document key right after it is created?
Right after adding this data, I would like to have the reference of this document.添加此数据后,我希望获得此文档的参考。
it is possible?有可能的?
await userCycleCollectionRef.doc().set({
userUid,
startDate,
endDate,
});
userCycleCollectionRef.doc()
returns a DocumentReference immediately, as you can see from the API documentation . userCycleCollectionRef.doc()
立即返回一个 DocumentReference,正如您从API 文档中看到的那样。
const ref = userCycleCollectionRef.doc()
await ref.set({
userUid,
startDate,
endDate,
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.