
I want to trigger a function every time there is any change in the db how do I do that?
for example lets say I have a blog and a user commented, I want to trigger a server function

you can trigger it by defining it from function settings from console

for example here I'm triggering one of my cloud function when new document is created in users collection

you can define the event in function settings. first of all deploy your function then goto appwrite console >functions >your-function > settings
then find Events. and add event.

you can learn more about events here: https://appwrite.io/docs/advanced/platform/events

got it, it is such a small section in the documentation for important feature

thanks!

@sophex89 Can I mark this as solved?
Recommended threads
- [GO] How to work with multiple local pac...
While deploying I get the error `my_module/sub: package my_module/sub is not in std (/usr/local/go/src/my_module/sub)` my code has only one module `my_module`...
- update_documents is called inside a func...
Traceback (most recent call last): File "/usr/local/server/src/function/src/main.py", line 23, in main result = databases.update_documents( File "/usr/l...
- PDO-Sql or Mysql connect from outside da...
Hi, i'm new user in Appwrite. wanna ask about Functions. i using runtime php 8.3. Try make php code to fetch data from outside database using PDO-sql and Mysql ...
