
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
- What's the best way to store user subscr...
I am confused whether I should store the external subscription status in the user object itself, or have different database for this.
- How exact time for Appwrite Functions ge...
As title, I want to know how much time Appwrite Cloud wait for Functions until it gets hibernated (cold start). 30m? 1h?
- How much should I wait for Appwrite Func...
Here's my situation: 1. Deploy the function first 2. Add API key(other service) in env 3. Redeploy 4. The function still cannot recognize my API key. I think i...
