Is it possible to create a function that listens to an database document update event and retrieve it's old values? Or do I need a workaround for that?
There was a feature request for something like this: https://github.com/appwrite/appwrite/issues/3294 You might want to 👍🏼 the issue.
One thing you can do is create a duplicate collection that contains the old document.
What exactly are you trying to do, though? What's your use case?
I need to verify if a change made by the user is valid. So yeah... I worked around the problem by creating a new doc with _old suffix... Since the user has no create permission for the collection at all this is safe to use i guess.
Gave the issue a 👍
sounds like you're doing input validation? In that case, I would have the user make the update by executing a function instead of calling the database service directly. the function would do validation and reject the request if it's not valid.
Recommended threads
- Permissions error
I try to create a row in my table but when i submit i have an error on my permission, i'm new on it so i dont understand the error. I have Row Security enable ...
- Console: Query on attribute has greater ...
I noticed an issue when one of my tables reached over ~800 rows. That table is relational to my users table Within the console I am able to view the table with ...
- Appwrite 1.8.1 TablesDB Permissions Issu...
Hi - I'm migrating a newer VueJS web application from Supabase to Appwrite. I'm looking for an experienced Appwrite Developer to help me solve a permissions iss...