[英]How do I schedule a batch update to a collection in my Firebase Firestore database using Cloud Functions?
[英]how to update a value in firebase cloud firestore database using Cloud Functions for Firebase
我正在嘗試使用雲觸發器功能來更新Cloud Firestore數據庫,但是每次在控制台中拋出它的錯誤時
我已經嘗試了下面的代碼,但是沒有運氣-
const ref = change.data().ref;
ref.update({
"isVerified": true
});
這是我的職能-
exports.updateLisenceKey_SendEmailToOwner = functions.firestore
.document('lisence_key/{userId}')
.onUpdate((change, context) => {
const ref = change.data().ref;
ref.update({
"isVerified": true
});
});
我希望該功能應更新Cloud Firestore數據庫中的節點
在研究了Firebase文檔之后,我發現可以使用以下代碼從Cloud Firestore更新觸發器功能更新數據庫-
return change.after.ref.set({
isVerified: true
}, {merge: true});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.