![](/img/trans.png)
[英]How to read a value from Firebase realtime database with a Google cloud functions?
[英]How to trigger realtime database field in Google Cloud server (not in functions of Firebase)
我需要從我的Google Cloud實例訪問Firebase的實時數據庫。 我加載庫並嘗試以與Firebase的雲功能相同的方式執行它,但它不會觸發任何事件。
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
functions.database.ref('stations/{stationID}/powerbanks/{powerbanksID}').onWrite((change, context) => {
console.log("Eject: ", context.params.stationID, context.params.powerbanksID, change.after.exists())
})
修改數據庫時,我看不到任何輸出。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.