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

查看:15
本文介绍了如何在读取事件上触发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天全站免登陆