2
如何發送每次將新文件添加到Android Studio的Firestore時生成的DocumentReference.getId()
到在Firestore上執行寫入/創建操作時觸發的雲端函數。 我嘗試以下如何從Google雲端掃描器觸發雲端功能
'use strict';
const https = require('firebase-functions');
const functions = require('firebase-functions');
const Firestore = require('@google-cloud/firestore');
const firestore = new Firestore();
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.helloUser = functions.firestore
.document('BankInform/Moj2HBrxepX5R7FonvrO')
.onUpdate(event =>{
var newValue = event.data.data();
return event.data.ref.update({
"status": "Success"
});
});
但我得給document.How的自動識別從Android工作室通過的文件編號爲雲功能
你還嘗試過什麼嗎?如果不是,我建議從[Firestore for Cloud Functions的觸發器文檔](https://firebase.google.com/docs/functions/firestore-events)開始。如果您遇到/遇到困難,請分享[重現您卡住的最小代碼](http://stackoverflow.com/help/mcve)。 –