Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to trigger firebase cloud function on read event

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?

like image 452
RyanQuey Avatar asked Oct 07 '17 07:10

RyanQuey


1 Answers

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.

like image 126
Doug Stevenson Avatar answered Nov 15 '22 06:11

Doug Stevenson