1
在JavaScript中,我寫了這樣的東西,但它返回錯誤>「文檔引用必須有偶數段」。我需要使用「設置」而不是「添加」我的情況。如何在Firebase的Cloud Firestore中添加這樣的數據?
const ref= db.collection("product");
ref.doc("111").doc("category").set({ clothes: true });
在Firebase的實時數據庫中,我可以編寫這樣的代碼,但在Firestore中我不能。
ref.child("111").child("category").set({ clothes: true });
如何在Firestore中編寫這樣的代碼?
謝謝。