如何在读取事件时触发Firebase云功能 [英] how to trigger firebase cloud function on read event

查看:69
本文介绍了如何在读取事件时触发Firebase云功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在写入事件中触发云功能 ,但是我在阅读后找不到用于触发的任何文档(例如,firebase.database().ref().once('value')...).

It is possible to trigger cloud functions on write events, but I can't find any documentation for triggering after reading (eg, firebase.database().ref().once('value')...).

关于处理此用例的最佳方法的任何建议吗?

Any recommendations on the best way to go about handling this use case?

推荐答案

没有用于响应客户端读取的触发器.假定应用程序将进行大量读取,并且为每个读取运行代码将非常昂贵.如果要在客户端执行某些操作时运行一些代码,请在应执行该操作时让客户端调用HTTPS函数.

There is no trigger for responding to client reads. It's assumed that apps will have massive amounts of reads, and having code run for each of those reads would be incredibly expensive. If you want to run some code when the client performs some action, have the client call an HTTPS function when that action should occur.

这篇关于如何在读取事件时触发Firebase云功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆