David Alonso
David Alonso10mo ago

Firestore trigger function alternative in Convex?

I'm coming from Firestore where one of my favorite features is the ability to automatically trigger functions when documents are written. What's the closest thing to this in Convex? Thanks!
5 Replies
erquhart
erquhart10mo ago
If you make a reusable function for writing to a given table, running a function on document write is trivial. I have this behavior in place for most of my tables and it works really well.
jamwt
jamwt10mo ago
yep, this is sort of the "ORM-trigger" method. many are using this right now
lee
lee5mo ago
in addition to the (great) suggestion above, you can also use this now https://stack.convex.dev/triggers
Database Triggers
Triggers automatically run code whenever data in a table changes. A library in the convex-helpers npm package allows you to attach trigger functions t...
erquhart
erquhart5mo ago
Nice!!

Did you find this page helpful?