Firestore 云函数不会触发事件,我的函数不会触发 onCreate、onUpdate、onDelete 或 onWrite。JS 脚本被成功推送到 Firestore。
数据库设计:
-|search
-|searchId
-|id: string
-|name: sting
-|img: string
规则:
match /search/{searchId}{
allow read;
allow write: if request.auth != null;
}
const functions = require('firebase-functions');
const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);
exports.updateIndex = functions.database.ref('/search/{searchId}').onWrite(event => {
console.log('Working')
}