![](/img/trans.png)
[英]Mongoose: How do I pass data from a document created afterwards into a document created right before?
[英]Can I get the document key right after it is created?
添加此數據后,我希望獲得此文檔的參考。
有可能的?
await userCycleCollectionRef.doc().set({
userUid,
startDate,
endDate,
});
userCycleCollectionRef.doc()
立即返回一個 DocumentReference,正如您從API 文檔中看到的那樣。
const ref = userCycleCollectionRef.doc()
await ref.set({
userUid,
startDate,
endDate,
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.