[英]How to update this firestore document field using cloud functions?
我是 firebase、firestore 和雲功能的新手。 如何根據名為“LastUpdatedAt”的字段更新名為“status”的此文件
exports.hello = functions.firestore.document("RealtimeData/{anyMachine}/Params/{anyParams}")
“LastUpdatedAt”字段在 {anyParams} 內:看起來像
LastUpdatedAt: 1606844285038
從時間戳轉換后
LastUpdatedAt: 1/12/2020 23:8:5
如何編寫雲 function 以將此“LastUpdatedAt”與當前時間進行比較,如果時間差大於 15,則“狀態”應設置為離線,否則應在線。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.