
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
- error code:524 for functions running lon...
We are having this issue, no longer the function runtime or code, if it goes longer than 1 minute, there's no logs at all, just this error: **error code: 524**
- Invalid `specification` param: Specifica...
I'm self-hosting my appwrite instance on my Macbook, and I created a Python function using the command `appwrite init functions` and it outputed the below into ...
- Local function throws EACCES error when ...
I am developing an Appwrite function locally. Up until now, the process has been as smooth as butter: I edit my files, save them, and this triggers a rebuild of...
